asp.net - Consume an "asp service" with Java (without WSDL) -


i'm not sure exact denomination, have "web asp service" (from .net application) gives me xml file. (there no wsdl...)

for exemple, can question web service url :

http://connectiquetest:86/vaudoise/srv_db/db2_personnes.asp?nopers=529720&searchmode=1&name=smith 

where nopers=52920, searchmode=1 , name=smith used return me response want. (the url internal system, cannot access without vpn)

the content type return : "text/xml" (it's classic well-formed xml).

so, how can use informations make call java application receive xml ? can tell me (maybe specific implementation of soap ?)

thanks !

the simple (and yet labor intensive) approach open httpurlconnection. can calling url.openconnection(). url object based on url mentioned, optionally appending parameters nopers, searchmode , name. call getinputstream() access response of call. next parsing xml interpret result.

however, said, requires lot of low-level code (especially when reading input, parsing xml, , on). consider using apache httpcomponents http-related work, combined jaxb converting retrieved xml plain old java objects.

using jaxb might require have xml schema. in ideal situation, exists (written people wrote asp service). in sub-ideal situation, you'll have derive yourself.


Comments