1 2 3 Previous Next 39 Replies Latest reply on May 24, 2016 10:53 AM by j_ri Go to original post
      • 15. Re: need a web service proxy quickstart in SwitchYard
        kcbabo

        Magesh nailed it with his post and example project.

         

        BTW, once we fix SWITCHYARD-226 in 0.4, then you won't even need a Java interface for XML->XML routes where you already have a WSDL.  That should make things even easier. 

        • 16. Re: need a web service proxy quickstart in SwitchYard
          alanchen

          Hi Magesh,

           

          I compare the switchyard.xml in your project with the switchyard.xml in my project. It is similar.  I just use a REMOTE server address (http://10.197.74.195:8080/MathService/servlet/mathService?wsdl). I will have a look in detail and let you know ASAP.

           

          Thank you very much!

           

          Alan

          • 17. Re: need a web service proxy quickstart in SwitchYard
            alanchen

            Hi Magesh,

             

            I test this demo project in two different ways.

             

            • deploy this WS war file in the same server with the SwitchYard project. It woks as we wish.
            • deploy this WS war file in the different server (I enable another application server instance with the listening port 18080. ). I attach the error message as the attachment. I can grab this wsdl file from the following address. http://localhost:18080/HelloService/servlet/helloService?wsdl.

             

            Regards!

            Alan

            • 18. Re: need a web service proxy quickstart in SwitchYard
              mageshbk

              Alan,

               

              The cause of the error is

              org.apache.cxf.transport.http.HTTPException: HTTP response '404: Not Found' when communicating with http://localhost:8080/HelloService/servlet/helloService
              

               

              So this means that the WSDL is parsed and processed, but unfortunately it is not updated to the correct address inside the WSDL

              <soap:address location="http://localhost:8080/HelloService/servlet/helloService"/>
              

               

              Change the above to

              <soap:address location="http://localhost:18080/HelloService/servlet/helloService"/>
              

               

              and redeploy your war, then it should work.

              • 19. Re: need a web service proxy quickstart in SwitchYard
                alanchen

                Yes Magesh, I update the port number as 18080 in HelloService.wsdl file and test it again. There is the same error listed in the attachment file. I doubt there are some problems in my computer. Magesh, would you mind to test it in your computer? I want to confirm it is the problem in my computer or not.  Thank you very much!

                • 20. Re: need a web service proxy quickstart in SwitchYard
                  alanchen

                  I may use this URL to grab the wsdl file.

                  http://localhost:18080/HelloService/servlet/helloService?wsdl.

                  • 21. Re: need a web service proxy quickstart in SwitchYard
                    alanchen

                    I deploy the HelloService.war in JBoss Application Server 7 listening on 18080. As to SwitchYard Server is listening on 8080.

                    • 22. Re: need a web service proxy quickstart in SwitchYard
                      mageshbk

                      Alan Chen wrote:

                       

                      I deploy the HelloService.war in JBoss Application Server 7 listening on 18080. As to SwitchYard Server is listening on 8080.

                      Which version of Application Server 7 is that? Does it show JBoss AS 7.0.2.Final "Arc" when started up? Can you paste the contents of http://localhost:18080/HelloService/servlet/helloService?wsdl here? I see that the war does not include any WSDL. So the soap:address should be equivalent to that used when requesting the WSDL.

                       

                      I tested it locally and it does work.

                      • 23. Re: need a web service proxy quickstart in SwitchYard
                        alanchen

                        sorry,  I do not include the wsdl file in WS war deployed in JBoss Application server ( is it necessary to include it? If it is; let me know how to do that ).

                         

                        As to the JBoss Application server information, I list as follow. There is no "Arc", when I run JBoss Application Server.

                         

                        D:\Study\JBoss\jboss-as-7.0.0.Final\bin>standalone.bat--server-config=standalone-preview.xml

                        Calling D:\Study\JBoss\jboss-as-7.0.0.Final\bin\standalone.conf.bat

                        ===============================================================================

                         

                          JBoss Bootstrap Environment

                         

                          JBOSS_HOME: D:\Study\JBoss\jboss-as-7.0.0.Final

                         

                          JAVA: C:\Program Files\Java\jdk1.6.0_19\bin\java

                         

                          JAVA_OPTS: -Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.serve

                        r.gcInterval=3600000 -Dorg.jboss.resolver.warning=true -Djboss.modules.system.pkgs=org.jboss.byteman -server

                         

                        ===============================================================================

                         

                        14:00:21,265 INFO  [org.jboss.modules] JBoss Modules version 1.0.1.GA

                        14:00:21,640 INFO  [org.jboss.msc] JBoss MSC version 1.0.0.GA

                        14:00:21,718 INFO  [org.jboss.as] JBoss AS 7.0.0.Final "Lightning" starting

                         

                         

                         

                        When it comes to the wsdl file, I grab it from JBoss Application server listed as following by using the URL: http://localhost:18080/HelloService/servlet/helloService?wsdl:

                         

                         

                         

                        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

                        <wsdl:definitions xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:switchyard-quickstart:camel-soap-proxy:1.0" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HelloService" targetNamespace="urn:switchyard-quickstart:camel-soap-proxy:1.0">

                         

                        <wsdl:types>

                         

                        <xs:schema xmlns:tns="urn:switchyard-quickstart:camel-soap-proxy:1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified"targetNamespace="urn:switchyard-quickstart:camel-soap-proxy:1.0" version="1.0">

                         

                        <xs:element name="hello" type="tns:hello"/>

                        <xs:element name="helloResponse" type="tns:helloResponse"/>

                         

                        <xs:complexType name="hello">

                         

                        <xs:sequence>

                         

                        <xs:element minOccurs="0" name="arg0" type="xs:string"/>

                        </xs:sequence>

                        </xs:complexType>

                         

                        <xs:complexType name="helloResponse">

                         

                        <xs:sequence>

                         

                        <xs:element minOccurs="0" name="return" type="xs:string"/>

                        </xs:sequence>

                        </xs:complexType>

                        </xs:schema>

                        </wsdl:types>

                         

                        <wsdl:message name="helloResponse">

                         

                        <wsdl:part element="tns:helloResponse" name="parameters"></wsdl:part>

                        </wsdl:message>

                         

                        <wsdl:message name="hello">

                         

                        <wsdl:part element="tns:hello" name="parameters"></wsdl:part>

                        </wsdl:message>

                         

                        <wsdl:portType name="HelloService">

                         

                        <wsdl:operation name="hello">

                         

                        <wsdl:input message="tns:hello" name="hello"></wsdl:input>

                        <wsdl:output message="tns:helloResponse" name="helloResponse"></wsdl:output>

                        </wsdl:operation>

                        </wsdl:portType>

                         

                        <wsdl:binding name="HelloServiceSoapBinding" type="tns:HelloService">

                         

                        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

                         

                        <wsdl:operation name="hello">

                         

                        <soap:operation soapAction="" style="document"/>

                         

                        <wsdl:input name="hello">

                         

                        <soap:body use="literal"/>

                        </wsdl:input>

                         

                        <wsdl:output name="helloResponse">

                         

                        <soap:body use="literal"/>

                        </wsdl:output>

                        </wsdl:operation>

                        </wsdl:binding>

                         

                        <wsdl:service name="HelloService">

                         

                        <wsdl:port binding="tns:HelloServiceSoapBinding" name="HelloServicePort">

                         

                        </wsdl:port>

                        </wsdl:service>

                        </wsdl:definitions>

                         


                        • 24. Re: need a web service proxy quickstart in SwitchYard
                          mageshbk

                          Alan Chen wrote:

                           

                          sorry,  I do not include the wsdl file in WS war deployed in JBoss Application server ( is it necessary to include it? If it is; let me know how to do that ).

                          No it is not needed.

                          As to the JBoss Application server information, I list as follow. There is no "Arc", when I run JBoss Application Server.

                           

                          14:00:21,718 INFO  [org.jboss.as] JBoss AS 7.0.0.Final "Lightning" starting

                          So that tells me you are using a very early version of AS7. The JBossWS/CXF stack had several issues and it has been corrected subsequently. Use the latest stable one AS7.0.2 from here http://www.jboss.org/jbossas/downloads/ and you should be good.

                          • 25. Re: need a web service proxy quickstart in SwitchYard
                            alanchen

                            Thanks Magesh, I will try it again and let you know ASAP.

                            • 26. Re: need a web service proxy quickstart in SwitchYard
                              alanchen

                              Magesh, thank you very much!

                               

                              when I deploy the WS war file in the JBoss Application server version 7.1, it works.

                               

                              The attachments are for others refrence! One is SwitchYard project provided by Magesh; the other is Web Service project.  Magesh, thank you for your help.

                              • 27. Re: need a web service proxy quickstart in SwitchYard
                                alanchen

                                Hi Magesh,

                                 

                                Besed on this case, I want to add another WS (MathService) into this project. MathService war file is deployed in another JBoss application server. How may I use the "ProxyService" in switchyard.xml file to proxy a new WS? Could you mind to add the configuration based on switchyard.xml file?

                                 

                                Best Regards!

                                Alan

                                • 28. Re: need a web service proxy quickstart in SwitchYard
                                  alanchen

                                  Keith,  As to  " then you won't even need a Java interface for XML->XML routes where you already have a WSDL." , it means that we do not need this Java interface file indicated in the element <sca:component> in switchyard.xml. is it right ?

                                   

                                  <sca:service name="ProxyService">

                                       <sca:interface.java interface="org.switchyard.quickstarts.camel.soap.proxy.HelloService"/>

                                  </sca:service>    

                                  • 29. Re: need a web service proxy quickstart in SwitchYard
                                    kcbabo

                                    Correct.  You would replace the interface.java with interface.wsdl (pointing to the same WSDL file that you use to configure the SOAP gateway).