Soap message name space issue on tomcat server - web-services

Hi I have a problem for quite some time that I can not solve. When I run my application on STS spring with spring run boot command, everything works fine. But if I try to deploy application on tomcat, everything works except the addition of a namespace to a soap message that reject the call to the soap service.
I insert below correct soap message on spring boot and follow the wrong message on tomcat.
SPING BOOT SUCCESS SOAP MSG:
<RetrieveDocumentSetRequest
xmlns="urn:ihe:iti:xds-b:2007"
xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"
xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
xmlns:ns4="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0"
xmlns:ns5="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0">
<DocumentRequest>
<RepositoryUniqueId>2.16.840.1.113883.2.9.2.999.4.5.113883</RepositoryUniqueId>
<DocumentUniqueId>2.16.840.1.113883.2.9.2.999.4.4^123456</DocumentUniqueId></DocumentRequest>
</RetrieveDocumentSetRequest>
TOMCAT 7 FAIL SOAP MSG:
<ns6:RetrieveDocumentSetRequest
xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"
xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
xmlns:ns4="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0"
xmlns:ns5="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0"
xmlns:ns6="urn:ihe:iti:xds-b:2007">
<DocumentRequest><RepositoryUniqueId>2.16.840.1.113883.2.9.2.999.4.5.113883</RepositoryUniqueId>
<DocumentUniqueId>2.16.840.1.113883.2.9.2.999.4.4^123456</DocumentUniqueId>
</DocumentRequest>
</ns6:RetrieveDocumentSetRequest>
As you can see messages are almost same except for n6 namespace. I can't understand why and if there is a wrong Jar on tomcat respect to springboot sever.

I have solved my problem.
The generator classes specified in the pom.xml of spring boot, using JAXB to generate classes from the interface WSDL, while the Jar that use and release of tomcat, using jax-ws library for generations of classes starting from WSDL.
The first library, JAXB, insert the annotation regarding the namespace, both on classes properties and inner classes of the generated classes. All this does not happen when using jax-ws, but only for some classes. This thing even if at first sight irrelevant, creates an answer rejected by the validator server side, the SOAP request sent.
I hope it will help someone in the future.

Related

Call JBoss Webservice from another JBoss instance

I was trying to call Webservice on JBoss(A) from another JBoss server(B).
I can invoke Webservice deployed on JBoss(A) nicely from the Webservice Client which I created with source code made by "wsimport".
But when I deploy this client onto JBoss(B) and called from Servlet, the client threw exception.
Root of the exception is
Caused by: javax.xml.ws.WebServiceException: Could not find service named {http://searchrequest}HotelSearchWebService in wsdl http://xxxxxx:8080/schedule_jsf/HotelSearchWebService?wsdl
I double checked urls and names, nothing is wrong.(I mean same names and addresses with local client which works fine)
I was thinking simply deploy Websevice Client on Server and it will work happy forever.
But it seems like some specific configuration needed.
Does someone have any idea?
Or if somebody knows any example source code on the web.
I will be happy with any information.
I have solved the problem.
Somehow my pojo parameters that created by jaxb had empty element name.
When I added annotation attribute, it worked fine.
Now everything is OK, my server is working beautiful.
Thanks for your visit and have a nice day, everyone.

WSO2 ESB Identity Server and Web Service Client

I'm refering to the following article
http://wso2.com/library/articles/2010/10/using-xacml-fine-grained-authorization-wso2-platform/
I would like to use the sample echoService from the WSO2 AS over a secured proxy in WSO2 ESB in combination with the Identity Server for fine-grained authorization. All the settings mentioned on this page seem to work, however I am stuck concerning the client part. I use NetBeans and the given client code, but the .jars in the classpath there have older versions then the ones in the current version of WSO2 IS, so I started to exchange them manually. Now I get some exceptions like
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xml.security.transforms.Transform.init()V
and I am stuck again. I just want to test the echoService in this constellation and send some string over the ESB via IS and receive the response(if I have the appropriate role) from the AS, is there not another client or how could I test it else?
Thank you!
I can suggest you 3 options:
Use SoapUI to test the service which is the easiest way to test a web service.
Generate the stub for the service and have stub as the dependency in your client. You can use the WSDL2Java tool that ship with AS. Loging to AS --> Tools in left pane --> WSDL2Java --> Provide the wsdl URL and generate the stub jar.
Generate correct dependency libs. Go to [IS-Home]/bin folder, and issue that command "ant" to run the build.xml, this will copy all required libs to [IS-HOME]/repository/lib/ folder. Have them in your class path.

Support both SOAP 1.1 and 1.2 by same JAX-WS service

I have a JAX-WS #WebServiceProvider and would like to support both SOAP 1.1 and 1.2 protocols. I handle creation of response SOAPMessage of proper version manually. I have WSDL describing bindings for both, 1.1 and 1.2 protocol.
But the service endpoint is only able to support either version at a time.
I would appreciate either a solution or a pointer to a piece of doc where it's stated that it's impossible.
P.S. i'm using WebSphere 7 app server, which is bundled with JAX-WS 2.0 (which is Axis2 based)
I experienced the same problem. The main issue for me is that it is not possible to compile the class with both #BindingType(value = SOAPBinding.SOAP12HTTP_BINDING) and #BindingType(value = SOAPBinding.SOAP11HTTP_BINDING). Have a look to this http://www-01.ibm.com/support/docview.wss?uid=swg1PK96819, and this http://www-01.ibm.com/support/docview.wss?uid=swg1PK83482, it should be possible to set #BindingType(SOAPBinding.SOAP_HTTP_BINDING) to have the both SOAP version to be delivered. Unfortunaltely, i did not compile also with the Websphere runtime environment, what i don't understand.
I recently dealt with a service deployment issue related to trying to simultaneously enable both SOAP 1.1 and 1.2 for a service (on WebSphere v7.0). Unfortunately, I don't think that your question gives enough information to provide a specific solution.
It IS possible to support both bindings at the same time, but there are some considerations. I think the main thing is that the server has to be able to listen on separate endpoints (URLs) for each binding. As near as I can tell, this requires appropriate entries in your web.xml and/or your webservices.xml configuraiton files.
For an annotation based service, these configuration entries are theoretically optional; but when you try to enable multiple bindings for a given service without the "optional" configuration entries, the WAS Axis2 extension fails with various possible exceptions.
If you could provide more detail about your wsdl, and the relevant portions of web.xml and webservices.xml (if any), as well as any error messages reported in the WAS log(s) during deployment and application startup, then I could probably give a better answer.

Service works in Tomcat doesn´t work on Servicemix

I´ve deployed a service into Tomcat 6 and into Servicemix 4.3
I´ve used soapUI 4 to send a request to the servers, from tomcat i get an answer, from servicemix i don´t. Both requests are differente Tomcat port 8080, servicemix port 8181.
The service is SOAP web-service in a .war file.
Has anyone done this type of migration? Do i need libraries in servicemix from tomcat?
the issue is likely your packaging/installation of your war and/or missing OSGi bundles...
see this blog post for info on using Servicemix as a web server...
essentially something like this...
osgi:install -s war:file:/tmp/sample.war?Webapp-Context=sample
then you should be able to go to http://localhost:8080/sample
also, this guide should help explain the OSGi war commands a bit...
Sorry, I'm confused.
Tomcat is a servlet/JSP engine, built to deploy servlets, JSPs and web services (given the proper library support).
ServiceMix is an ESB that can do routing to servlets, transforming of messages, guarantee delivery, workflow, and other services. It's supposed to decouple producers of messages from consumers.
I don't see ServiceMix as an alternative deployment platform for servlets and JSPs. I see them as complementary, not one replacing the other.

Invalid WSDL request message (HTTP 405) on WSDL request (Glassfish v3)

I've a web service, which is basically a #Stateless EJB annotated with #WebService, and other JAX-WS related annotations. I can deploy this bean on my machine's glassfish instance, and see its WSDL through Glassfish's administrative GUI. I can also call its methods without any problems, from a SE client.
When I deploy this web service to a server instance in any other machine, I can no longer browse its WSDL through glassfish, and the client fails to connect to the server. The message displayed is:
Invalid WSDL request: http://ip:port/context/serviceEndpoint?wsdl
The HTTP error returned by Glassfish on such request is 405 (method not allowed).
I browsed around, and couldn't get anything directly related to glassfish v3. There are issues open on Glassfish's bugzilla for version 2, meaning they're old and have been labelled as CLOSED/FIXED already.
Anyone ran into this before? Any help or any clues about what could be happening here?
Thanks in advance!
For the sake of those who might come across this problem one day: I had OpenSSO on the target server. And by many obvious reasons, it was a classpath clashing problem that prevented the WSDL to be generated by glassfish.
Once OpenSSO has been removed of the equation, everything worked as it was supposed too. So, even if you're not an OpenSSO user, check your classpath for multiple Metro instances, or any other JAX related library that might be conflicting with glassfish's own on your domain.