Link to home
Create AccountLog in
Avatar of ts84zs
ts84zs

asked on

Read Soap services in .net

I have to read data published on soap-services.

I have the WSDL of the soap service.

In order to request the data or to connect to that soap-service, first of all, I have to connect using userid/password.

Then I have to pass a request whose xml looks like this -

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cm="http://oracle.com/mysoapservices.xsd">
   <soapenv:Header/>
   <soapenv:Body>
      <mysoapservices>
    <request>
        <assignmentId></assignmentId>
        <needCompletionDetails>Y</needCompletionDetails>  
        <hostSystem>myhostsystem</hostSystem>
    </request>  
      </mysoapservices>
   </soapenv:Body>
</soapenv:Envelope>

That request will send a response, which will also be xml-format...
I have to write that data to a database . I can do like whats mentioned in  https://msdn.microsoft.com/en-us/library/bb628652.aspx but I have to  access the data  by passing that xml-request object and getting xml-response object...

How should i do it.  I want to do it in .net

Thanks so much...
Avatar of ste5an
ste5an
Flag of Germany image

See Using the SOAP Interface.

That request will send a response, which will also be xml-format...
Obvious, that's how SOAP works.

I have to  access the data  by passing that xml-request object and getting xml-response object...
When it is a SOAP Service: Then NO, you have not to do that. Cause adding the web service reference to your project will create all the necessary code behind, so that you can access those values by the generated classes,
Avatar of ts84zs
ts84zs

ASKER

Is that the only way to access read soap services...
No, but that's the reason why SOAP service are built they way they are.
Avatar of ts84zs

ASKER

Ok thanks so much... So that's the best way to do it ?
Yup.
Avatar of ts84zs

ASKER

Ok thanks a lot
Avatar of ts84zs

ASKER

i found this one another way  to access SOAP - http://www.roelvanlisdonk.nl/?p=1893.. its like using HttpWebRequest class
What are pros & cons of both the methods? thanks so much....
It ignores the SOAP stack in VS... so you may do it like that. But you will have a much harder day finding bugs in your code.
Avatar of ts84zs

ASKER

Thanks so much... Can you please send me more information like link that provides such tips for accessing soap services or books
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of ts84zs

ASKER

thanks so much
Avatar of ts84zs

ASKER

My SOAP services are created using  some oracle obiee server .. So  I cannot use SOAPClient class...
Does it provide a WSDL?
Avatar of ts84zs

ASKER

Yes
Then use this WSDL to add your service reference.
Avatar of ts84zs

ASKER

ok... thanks so much....
Hi,

I would like to urge you on following ste5an's advice. Yes, you can call SOAP manually as that article describes, but why? It would be like reinventing the wheel, when the adding a Service Reference will do the hard job for you. After that you do not have to care about the XML, you will get actual .Net classes to fill in and use for your requests and responces.

Giannis