Topic
  • 11 replies
  • Latest Post - ‏2011-09-02T19:23:14Z by SystemAdmin
ashisbx
ashisbx
4 Posts

Pinned topic Unable to call external WebService from SCA Project

‏2011-09-01T00:02:35Z |
Hi,
After a lot of attempts,I'm unable to call a simple HelloWorldService developed in .NET env. The service is available at http://tstbcbssubconnector.pivot.com/HelloWorld/Service1.svc. In order to call this service, I used the WAS utility WSDL2Java and got java interface and imported them into my SCA Project.

In my composite file, I had referred it like:
<sca:reference name="IService1Ref">
<sca:interface.java interface="org.tempuri.IService1"/>
<!-- The exact URL is obtained from a service provider. -->
<sca:binding.ws uri="http://tstbcbssubconnector.pivot.com/HelloWorld/Service1.svc"/>
</sca:reference>

And trying to call just the simple method which accepts String input.
But I'm always getting the error :
SystemErr R Caused by: org.apache.axis2.AxisFault: The message with Action 'urn:helloWorld' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

Although I'm able to call this service from my SoapUI.

If anybody had faced similar problem, then please let me know about it.
Updated on 2011-09-02T19:23:14Z at 2011-09-02T19:23:14Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Unable to call external WebService from SCA Project

    ‏2011-09-01T05:04:28Z  
    Are you behind your company's firewall?

    Perhaps your SOAPUI has proxy configuration already, but you haven't set up your server (where your SCA project is deployed) to go thru the your corporate firewall?

    If you try the SCA project outside the firewall (eg. from home or your server going thru your USB internet).
  • ashisbx
    ashisbx
    4 Posts

    Re: Unable to call external WebService from SCA Project

    ‏2011-09-01T12:21:58Z  
    Are you behind your company's firewall?

    Perhaps your SOAPUI has proxy configuration already, but you haven't set up your server (where your SCA project is deployed) to go thru the your corporate firewall?

    If you try the SCA project outside the firewall (eg. from home or your server going thru your USB internet).
    Thanks for the comments zqudlyba, but its not an issue of firewall, as I'm able to invoke the service from SoapUI from my office as well as from home and I haven't configured any proxy for my soapui. Its just not working for some reason and I don't know what.
    I'm just stuck at this point....

    Please let me know if you can think of anything else.
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Unable to call external WebService from SCA Project

    ‏2011-09-01T13:51:05Z  
    • ashisbx
    • ‏2011-09-01T12:21:58Z
    Thanks for the comments zqudlyba, but its not an issue of firewall, as I'm able to invoke the service from SoapUI from my office as well as from home and I haven't configured any proxy for my soapui. Its just not working for some reason and I don't know what.
    I'm just stuck at this point....

    Please let me know if you can think of anything else.
    Hi ashisbx,

    First, you should not be using WSDL2Java but rather the 'wsimport' tool to generate Java from WSDL for use in SCA apps.

    This is documented in http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.soafep.multiplatform.doc/info/ae/ae/tsca_devscawsdl_topdown.html

    Please give that a try and see where you end up. If you have further problems and are willing to paste the symptoms along with this WSDL I'd be happy to take a look to see if I can guess what's going on.

    Regards,
    Scott Kurz
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Unable to call external WebService from SCA Project

    ‏2011-09-01T13:52:46Z  
    Hi ashisbx,

    First, you should not be using WSDL2Java but rather the 'wsimport' tool to generate Java from WSDL for use in SCA apps.

    This is documented in http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.soafep.multiplatform.doc/info/ae/ae/tsca_devscawsdl_topdown.html

    Please give that a try and see where you end up. If you have further problems and are willing to paste the symptoms along with this WSDL I'd be happy to take a look to see if I can guess what's going on.

    Regards,
    Scott Kurz
    Sorry, I guess I need to work on my forum syntax.

    Here is the link again:

    By the way, the WSDL2Java is the JAX-RPC level tooling, whereas SCA uses the JAX-WS level tooling.
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Unable to call external WebService from SCA Project

    ‏2011-09-01T14:19:25Z  
    Sorry, I guess I need to work on my forum syntax.

    Here is the link again:

    By the way, the WSDL2Java is the JAX-RPC level tooling, whereas SCA uses the JAX-WS level tooling.
    Hi again ashisbx,

    Actually I think I already know what's going on, come to think of it, (and, no, I'm not getting paid for answering in multiple posts ;) ).

    Your operation's soapAction doesn't match.

    The reason is that by using syntax:

    <sca:binding.ws uri="http://tstbcbssubconnector.pivot.com/HelloWorld/Service1.svc"/>

    you are telling the runtime to generate a WSDL, and then use the @uri value as the URL endpoint on top of the generated WSDL. The generated soapAction is urn:helloWorld, which doesn't match.

    What you want to do is to refer to the soapAction in the existing WSDL, which you can do by syntax:

    <sca:binding.ws wsdlElement="http://tempuri.org/#wsdl.port(Service1/BasicHttpBinding_IService1)”/>

    Or, if the URL weren't present as the WSDL soap:address for some reason (which it is, however), you could even do:

    <sca:binding.ws wsdlElement="http://tempuri.org/#wsdl.port(Service1/BasicHttpBinding_IService1)” uri="http://tstbcbssubconnector.pivot.com/HelloWorld/Service1.svc"/>

    This is documented in this article, though it is a bit long since there are several options and it discusses callbacks as well.

    But it's step 2a. under section:

    Configure an SCA reference (client) with an SCA Web service binding.

    Hope that helps, please let us know.

    Regards,
    Scott Kurz
  • ashisbx
    ashisbx
    4 Posts

    Re: Unable to call external WebService from SCA Project

    ‏2011-09-01T15:23:27Z  
    Hi again ashisbx,

    Actually I think I already know what's going on, come to think of it, (and, no, I'm not getting paid for answering in multiple posts ;) ).

    Your operation's soapAction doesn't match.

    The reason is that by using syntax:

    <sca:binding.ws uri="http://tstbcbssubconnector.pivot.com/HelloWorld/Service1.svc"/>

    you are telling the runtime to generate a WSDL, and then use the @uri value as the URL endpoint on top of the generated WSDL. The generated soapAction is urn:helloWorld, which doesn't match.

    What you want to do is to refer to the soapAction in the existing WSDL, which you can do by syntax:

    <sca:binding.ws wsdlElement="http://tempuri.org/#wsdl.port(Service1/BasicHttpBinding_IService1)”/>

    Or, if the URL weren't present as the WSDL soap:address for some reason (which it is, however), you could even do:

    <sca:binding.ws wsdlElement="http://tempuri.org/#wsdl.port(Service1/BasicHttpBinding_IService1)” uri="http://tstbcbssubconnector.pivot.com/HelloWorld/Service1.svc"/>

    This is documented in this article, though it is a bit long since there are several options and it discusses callbacks as well.

    But it's step 2a. under section:

    Configure an SCA reference (client) with an SCA Web service binding.

    Hope that helps, please let us know.

    Regards,
    Scott Kurz
    Thanks for the update ScottKurz,

    What u r saying is just the opposite.
    If I go by adding all the wsdlElement, #wsdl.port and URI information inside the binding.ws, SCA runitme treats it as if I'm trying to create a new WSDL and it throws error when I deploy the BusinessLevelApplication.
    But on the other hand if do my composite file setting as :
    <sca:reference name="IService1Ref">
    <sca:interface.java interface="org.tempuri.IService1"/>
    <!-- The exact URL is obtained from a service provider. -->
    <sca:binding.ws uri="http://tstbcbssubconnector.pivot.com/HelloWorld/Service1.svc"/>
    </sca:reference>

    It doesn't tries to create a new WSDL and uses this URI information to make a WS call.
    And I do see in my logs that it is making a call as the logs shows:
    CHFW0019I: The Transport Channel Service has started chain HttpOutboundChain:tstbcbssubconnector.pivot.com:80.

    Also in order to confirm if I'm able to make a webservice call, I developed a hello world in my env and deployed it and call it...and the call goes smoothly.
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Unable to call external WebService from SCA Project

    ‏2011-09-01T15:37:25Z  
    • ashisbx
    • ‏2011-09-01T15:23:27Z
    Thanks for the update ScottKurz,

    What u r saying is just the opposite.
    If I go by adding all the wsdlElement, #wsdl.port and URI information inside the binding.ws, SCA runitme treats it as if I'm trying to create a new WSDL and it throws error when I deploy the BusinessLevelApplication.
    But on the other hand if do my composite file setting as :
    <sca:reference name="IService1Ref">
    <sca:interface.java interface="org.tempuri.IService1"/>
    <!-- The exact URL is obtained from a service provider. -->
    <sca:binding.ws uri="http://tstbcbssubconnector.pivot.com/HelloWorld/Service1.svc"/>
    </sca:reference>

    It doesn't tries to create a new WSDL and uses this URI information to make a WS call.
    And I do see in my logs that it is making a call as the logs shows:
    CHFW0019I: The Transport Channel Service has started chain HttpOutboundChain:tstbcbssubconnector.pivot.com:80.

    Also in order to confirm if I'm able to make a webservice call, I developed a hello world in my env and deployed it and call it...and the call goes smoothly.
    Hi ashisbx,

    The main point I'm making is that:

    1. your service is complaining about the soapAction value
    2. From the client side, instead of referencing the existing WSDL's soapAction, you were using a generated one.

    So I showed you the syntax to reference the existing WSDL instead of generating it.

    Please note my earlier comment about the need to use wsimport rather than WSDL2Java, as you will almost definitely run into troubles at some point unless you use the correct tooling to generate the Java.

    Scott
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Unable to call external WebService from SCA Project

    ‏2011-09-01T19:41:07Z  
    The URI value should point to the endpoint, that is: http://tstbcbssubconnector.pivot.com/HelloWorld/Service1.svc?wsdl, I have created a small project that consumes your Hello World and the output of such service is "You entered: value"
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Unable to call external WebService from SCA Project

    ‏2011-09-01T19:49:40Z  
    The URI value should point to the endpoint, that is: http://tstbcbssubconnector.pivot.com/HelloWorld/Service1.svc?wsdl, I have created a small project that consumes your Hello World and the output of such service is "You entered: value"
    I just tried the other URI and it's also working, I guess that as Scott mention we should use wsimport to generate the interfaces. BTW, I do that using RAD and it is really simple, if you want I can either provide steps to do such thing form RAD or attach the project.
  • ashisbx
    ashisbx
    4 Posts

    Re: Unable to call external WebService from SCA Project

    ‏2011-09-02T17:02:39Z  
    I just tried the other URI and it's also working, I guess that as Scott mention we should use wsimport to generate the interfaces. BTW, I do that using RAD and it is really simple, if you want I can either provide steps to do such thing form RAD or attach the project.
    Hi Scott and everbody,

    Thanks a lot for all the prompt replies.
    Well y'day my issue was resolved and Scott, yes you said right that I should have used wsimport instead of wsdl2java utility. But what was happening, on using wsimport it was generating all the class files for me and I was not sure how will I call the methods of the interface if only class are there.
    But then later I used the option -keep with wsimport and it generated the java files as well & lot many files which Imported in my project and then it worked all smooth.

    Thanks for all your help and time.
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Unable to call external WebService from SCA Project

    ‏2011-09-02T19:23:14Z  
    • ashisbx
    • ‏2011-09-02T17:02:39Z
    Hi Scott and everbody,

    Thanks a lot for all the prompt replies.
    Well y'day my issue was resolved and Scott, yes you said right that I should have used wsimport instead of wsdl2java utility. But what was happening, on using wsimport it was generating all the class files for me and I was not sure how will I call the methods of the interface if only class are there.
    But then later I used the option -keep with wsimport and it generated the java files as well & lot many files which Imported in my project and then it worked all smooth.

    Thanks for all your help and time.
    Let me just quickly explain the generated classes:

    The @WebService-annotated interface is the service endpoint interface (SEI). This will be the type of your @Reference-annotated proxy in your client implementation.

    The rest of the generated classes contain JAXB annotations to help the runtime map between your Java application data and the XML wireformat, and so they should be packaged along with your application.

    Except, however, the class generated with the @WebServiceClient annotation. This is not needed in an SCA context, but since we use the same wsimport tooling it is generated anyway.

    Scott