Consuming JDeveloper Web Service in ASP.NET C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SteveHasel
    New Member
    • Aug 2007
    • 17

    Consuming JDeveloper Web Service in ASP.NET C#

    I'm trying to consume a web service that was generated by Oracle JDeveloper for a ASP.NET site in Visual Studio 2005. I used the Add Web Reference interface and everything seemed to work fine, but when I tried to reference the methods in the web service, they weren't there. In their stead were general web service functions and properties(like CreateObjRef, Discover, SoapVersion, etc).

    The url I used when adding the web reference was this:


    It showed the functions that I wanted reference, but after clicking the Add Reference button, it only created a subfolder with a discomap and a wsdl file. Would someone please tell me what I'm doing wrong? Also, if you need any other information, feel free to ask.

    Thanks,
    Steve
  • davef
    New Member
    • Sep 2007
    • 98

    #2
    Originally posted by SteveHasel
    I'm trying to consume a web service that was generated by Oracle JDeveloper for a ASP.NET site in Visual Studio 2005. I used the Add Web Reference interface and everything seemed to work fine, but when I tried to reference the methods in the web service, they weren't there. In their stead were general web service functions and properties(like CreateObjRef, Discover, SoapVersion, etc).

    The url I used when adding the web reference was this:


    It showed the functions that I wanted reference, but after clicking the Add Reference button, it only created a subfolder with a discomap and a wsdl file. Would someone please tell me what I'm doing wrong? Also, if you need any other information, feel free to ask.

    Thanks,
    Steve
    Have you not gotten Reference.cs proxy file created under the Webservice reference folder?

    Comment

    • SteveHasel
      New Member
      • Aug 2007
      • 17

      #3
      Originally posted by davef
      Have you not gotten Reference.cs proxy file created under the Webservice reference folder?
      No, the only folder that was created after the web reference was added was called SiteUpdate(my namespace) and the discomap and wsdl files inside the folder. This was added under the App_WebReferenc es folder.

      Comment

      • davef
        New Member
        • Sep 2007
        • 98

        #4
        Originally posted by SteveHasel
        No, the only folder that was created after the web reference was added was called SiteUpdate(my namespace) and the discomap and wsdl files inside the folder. This was added under the App_WebReferenc es folder.
        This is a pretty common crap with non-Microsoft web services to be consumed by MS clients. I had a similar problem with Java-based web services some time ago (their datatype wouldn't be deserialized correctly in .NET). For instance, if you reference the TerraService by MS (WSDL http://terraservice.ne t/TerraService2.a smx), you won't have a trouble at all.

        Comment

        • SteveHasel
          New Member
          • Aug 2007
          • 17

          #5
          Originally posted by davef
          This is a pretty common crap with non-Microsoft web services to be consumed by MS clients. I had a similar problem with Java-based web services some time ago (their datatype wouldn't be deserialized correctly in .NET). For instance, if you reference the TerraService by MS (WSDL http://terraservice.ne t/TerraService2.a smx), you won't have a trouble at all.
          Yea, I read around and it was at first difficult to find examples of people that had successfully done this, but they do exist. That's why I'm wondering if I'm going about it wrong. I tried the wsdl.exe, but I'm not able to use that for some reason or another.

          Comment

          • davef
            New Member
            • Sep 2007
            • 98

            #6
            Originally posted by SteveHasel
            Yea, I read around and it was at first difficult to find examples of people that had successfully done this, but they do exist. That's why I'm wondering if I'm going about it wrong. I tried the wsdl.exe, but I'm not able to use that for some reason or another.
            I'd love to find the answer myself. Running wsdl.exe is what the VS studio does when you reference the webservice, you won't get a different result from the command line. I wonder what you see when you browse the WSDL page itself.

            Comment

            • SteveHasel
              New Member
              • Aug 2007
              • 17

              #7
              Originally posted by davef
              I'd love to find the answer myself. Running wsdl.exe is what the VS studio does when you reference the webservice, you won't get a different result from the command line. I wonder what you see when you browse the WSDL page itself.
              I've done that and I see all the xml of the wsdl file.

              Comment

              • davef
                New Member
                • Sep 2007
                • 98

                #8
                Originally posted by SteveHasel
                I've done that and I see all the xml of the wsdl file.
                Is it structurally different than that of let's say TerraService WSDL? I believe it is.

                Comment

                • SteveHasel
                  New Member
                  • Aug 2007
                  • 17

                  #9
                  It's something like this:

                  <?xml version="1.0" encoding="UTF-8" ?>
                  - <!-- Generated by the Oracle JDeveloper 10g Web Services WSDL Generator
                  -->
                  - <!-- Date Created: Tue Jun 21 11:31:32 EDT 2005
                  -->
                  - <definitions name="UpdateWeb Service" targetNamespace ="http://db/UpdateWebServic e.wsdl" xmlns="http://schemas.xmlsoap .org/wsdl/" xmlns:xsd="http ://www.w3.org/2001/XMLSchema" xmlns:soap="htt p://schemas.xmlsoap .org/wsdl/soap/" xmlns:tns="http ://db/Update.wsdl" xmlns:ns1="http ://db/UpdateWebServic e.xsd">
                  - <types>
                  <schema targetNamespace ="http://db/UpdateWebServic e.xsd" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap .org/soap/encoding/" />
                  </types>
                  - <message name="updatestu dent0Request">
                  <part name="xstudenti nfo" element="xsd:an y" />
                  </message>
                  - <message name="updatestu dent0Response">
                  <part name="return" element="xsd:an y" />
                  </message>
                  - <message name="processxr egrequest1Reque st">
                  <part name="xregreque st" element="xsd:an y" />
                  </message>
                  - <message name="processxr egrequest1Respo nse">
                  <part name="return" element="xsd:an y" />
                  </message>
                  - <portType name="UpdateWeb ServicePortType ">
                  - <operation name="updatestu dent">
                  <input name="updatestu dent0Request" message="tns:up datestudent0Req uest" />
                  <output name="updatestu dent0Response" message="tns:up datestudent0Res ponse" />
                  </operation>
                  - <operation name="processxr egrequest">
                  <input name="processxr egrequest1Reque st" message="tns:pr ocessxregreques t1Request" />
                  <output name="processxr egrequest1Respo nse" message="tns:pr ocessxregreques t1Response" />
                  </operation>
                  </portType>
                  - <binding name="UpdateWeb ServiceBinding" type="tns:Updat eWebServicePort Type">
                  <soap:binding style="rpc" transport="http ://schemas.xmlsoap .org/soap/http" />
                  - <operation name="updatestu dent">
                  <soap:operati on soapAction="" style="rpc" />
                  - <input name="updatestu dent0Request">
                  <soap:body use="literal" namespace="Upda teWebService" />
                  </input>
                  - <output name="updatestu dent0Response">
                  <soap:body use="literal" namespace="Upda teWebService" />
                  </output>
                  </operation>
                  - <operation name="processxr egrequest">
                  <soap:operati on soapAction="" style="rpc" />
                  - <input name="processxr egrequest1Reque st">
                  <soap:body use="literal" namespace="Upda teWebService" />
                  </input>
                  - <output name="processxr egrequest1Respo nse">
                  <soap:body use="literal" namespace="Upda teWebService" />
                  </output>
                  </operation>
                  </binding>
                  - <service name="UpdateWeb Service">
                  - <port name="UpdateWeb ServicePort" binding="tns:Up dateWebServiceB inding">
                  <soap:address location="https ://site.org/UpdateWebServic e/UpdateWebServic e" />
                  </port>
                  </service>
                  </definitions>

                  Comment

                  • davef
                    New Member
                    • Sep 2007
                    • 98

                    #10
                    Yeah, the SOAP structure is so different I don't even know where to start. I myself haven't seen too many successful examples of web service interoperabilit y (aren't they supposed to be interoperable BTW??). As a workaround, our team and I at the time had to switch to servlets communicating with them via standard HTTP response-request pattern from .NET.

                    Comment

                    • SteveHasel
                      New Member
                      • Aug 2007
                      • 17

                      #11
                      Originally posted by davef
                      Yeah, the SOAP structure is so different I don't even know where to start. I myself haven't seen too many successful examples of web service interoperabilit y (aren't they supposed to be interoperable BTW??). As a workaround, our team and I at the time had to switch to servlets communicating with them via standard HTTP response-request pattern from .NET.
                      I've tried several different workarounds including using HTTPWebRequest, which doesn't correctly wrap it in a soap envelope. I've also tried the SoapClient and it disagrees with some of the xml I was trying to use. I'm really at a loss on how to do it.

                      Comment

                      • davef
                        New Member
                        • Sep 2007
                        • 98

                        #12
                        Originally posted by SteveHasel
                        I've tried several different workarounds including using HTTPWebRequest, which doesn't correctly wrap it in a soap envelope. I've also tried the SoapClient and it disagrees with some of the xml I was trying to use. I'm really at a loss on how to do it.
                        Are you in control of the Web service or at least have a say with their developers?

                        Comment

                        • SteveHasel
                          New Member
                          • Aug 2007
                          • 17

                          #13
                          Originally posted by davef
                          Are you in control of the Web service or at least have a say with their developers?
                          I am not in control of the web service and I'm not sure how much of a say I have with their developers considering this company could be making this web service for several different companies. It's a registration system designed to be used by anyone. I am in contact with at least a representative from there. Do you have a suggestion to pass on?

                          Thanks for your help so far, btw.

                          Comment

                          • davef
                            New Member
                            • Sep 2007
                            • 98

                            #14
                            Originally posted by SteveHasel
                            I am not in control of the web service and I'm not sure how much of a say I have with their developers considering this company could be making this web service for several different companies. It's a registration system designed to be used by anyone. I am in contact with at least a representative from there. Do you have a suggestion to pass on?

                            Thanks for your help so far, btw.
                            • I would contact their tech support asking if their web service is intended to be consumed by .NET client AT ALL and if they know of ANYONE who did it before. However, this may yield little to zero results even if they say positively.
                            • Ask for alternative methods of communication with their datastore (e.g., they might have pre-webservice legacy protocols in place like FTP or even RPC).
                            • You can at last write your client in Java if you know it making it a "wrapper" around the webservice so that your .NET apps can communicate with it.

                            Comment

                            • SteveHasel
                              New Member
                              • Aug 2007
                              • 17

                              #15
                              You mentioned you had a workaround for it, well I got the actual xml file you need to create for it, but I'm not very good with putting together xml files in C#. It basically needs to look like this. I feel like if I can put this together I can send an HttpWebRequest and just stream write the file to the web service. Here's the basic format of the xml file:

                              <soap:Envelop e xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http ://www.w3.org/2001/XMLSchema" xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/">
                              <soap:Body>
                              <ns1:processxre grequest xmlns:ns1="Upda teWebService" soap:encodingSt yle="http://xml.apache.org/xml-soap/literalxml">
                              <xregrequest>
                              <AIXREGREQUES T xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" version="1.00">
                              <all data goes in between here>
                              </AIXREGREQUEST>
                              </xregrequest>
                              </ns1:processxreg request>
                              </soap:Body>
                              </soap:Envelope>

                              Would it be possible to create this in C#? The problem I ran into was when I tried to create the elements involving soap:Envelope or ns1:processxreg request it would just show the Envelope or processxregrequ est parts and ignore the soap and ns1 parts respectively.

                              Comment

                              Working...