tag:blogger.com,1999:blog-1117705343685907636.post1758080187034502204..comments2024-03-18T11:40:22.238+04:00Comments on Just Compiled...: Web Service Client with Spring-WSShameerhttp://www.blogger.com/profile/06903097920110814058noreply@blogger.comBlogger51125tag:blogger.com,1999:blog-1117705343685907636.post-10206723108081883772015-06-07T20:01:19.061+04:002015-06-07T20:01:19.061+04:00Hi Shameer
I am new to WebServices. I have followe...Hi Shameer<br />I am new to WebServices. I have followed both the blogs<br />a) http://justcompiled.blogspot.com/2010/09/building-web-service-with-spring-ws.html<br />b) http://justcompiled.blogspot.com/2010/11/web-service-client-with-spring-ws.html<br /><br />My WebService is deployedon Tomcat 7.0.33 and I can view the wsdl file using URL: http://localhost:8080/liverestaurant/spring-ws/OrderService.wsdl<br /><br />But when I try to run the OrderServiceClientTest.java for testPlaceOrder(), I am getting <br /><br />org.springframework.ws.client.WebServiceTransportException: Not Found [404]<br /><br />on LiveRestaurant/spring-ws/OrderService<br /><br />My placeOrderRequest from OrderServicePayloadRootAnnotationEndPoint.java looks as follows:<br /><br />@PayloadRoot(localPart = "placeOrderRequest", namespace = "http://www.liverestaurant.com/OrderService/schema")<br /> public JAXBElement getOrder(PlaceOrderRequest placeOrderRequest) {<br /> PlaceOrderResponse response = JAXB_OBJECT_FACTORY.createPlaceOrderResponse();<br /> response.setRefNumber(orderService.placeOrder(placeOrderRequest.getOrder()));<br /> <br /> return new JAXBElement(new QName("http://www.liverestaurant.com/OrderService/schema",<br /> "placeOrderResponse"), PlaceOrderResponse.class, response);<br /> }<br /><br />Please advice. Anonymoushttps://www.blogger.com/profile/10135166276673264634noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-50764279722202415102015-06-07T20:01:11.782+04:002015-06-07T20:01:11.782+04:00Hi Shameer
I am new to WebServices. I have followe...Hi Shameer<br />I am new to WebServices. I have followed both the blogs<br />a) http://justcompiled.blogspot.com/2010/09/building-web-service-with-spring-ws.html<br />b) http://justcompiled.blogspot.com/2010/11/web-service-client-with-spring-ws.html<br /><br />My WebService is deployedon Tomcat 7.0.33 and I can view the wsdl file using URL: http://localhost:8080/liverestaurant/spring-ws/OrderService.wsdl<br /><br />But when I try to run the OrderServiceClientTest.java for testPlaceOrder(), I am getting <br /><br />org.springframework.ws.client.WebServiceTransportException: Not Found [404]<br /><br />on LiveRestaurant/spring-ws/OrderService<br /><br />My placeOrderRequest from OrderServicePayloadRootAnnotationEndPoint.java looks as follows:<br /><br />@PayloadRoot(localPart = "placeOrderRequest", namespace = "http://www.liverestaurant.com/OrderService/schema")<br /> public JAXBElement getOrder(PlaceOrderRequest placeOrderRequest) {<br /> PlaceOrderResponse response = JAXB_OBJECT_FACTORY.createPlaceOrderResponse();<br /> response.setRefNumber(orderService.placeOrder(placeOrderRequest.getOrder()));<br /> <br /> return new JAXBElement(new QName("http://www.liverestaurant.com/OrderService/schema",<br /> "placeOrderResponse"), PlaceOrderResponse.class, response);<br /> }<br /><br />Please advice. <br />Anonymoushttps://www.blogger.com/profile/10135166276673264634noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-66491736903613334352015-04-07T20:41:35.176+04:002015-04-07T20:41:35.176+04:00Was looking for this only to implement in my proje...Was looking for this only to implement in my project.<br />Thanks a ton.<br />Thanks again.Anonymoushttps://www.blogger.com/profile/04983378593267862384noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-65524212525626483792015-04-07T20:40:54.333+04:002015-04-07T20:40:54.333+04:00Was looking for this only to implement in my proje...Was looking for this only to implement in my project.<br />Thanks a ton.<br />Thanks again.Anonymoushttps://www.blogger.com/profile/04983378593267862384noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-9140685298449913482013-10-28T16:36:14.176+04:002013-10-28T16:36:14.176+04:00Hi Shameer,
When I am trying to deploy my war fi...Hi Shameer, <br /><br />When I am trying to deploy my war file into dev server and hitting url, I am getting proper response. Same war trying to add in local. I am getting org.jboss.ws.core.soap.SOAPContentElement - transitionTo:137 Transitioning from XML_VALID to DOM_VALID, com.xxx.xxxx.xxxxx.xxx.xxx- xxx:31 Input validation errorRajeshhttps://www.blogger.com/profile/09189589664399593727noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-81628165528122641742013-05-02T14:29:32.213+04:002013-05-02T14:29:32.213+04:00@Christopher, this is just a Log4J warning, you ca...@Christopher, this is just a Log4J warning, you can configure Log4j in your app by just adding a log4j.properties or xml file, it really helps to find out the problems in your code.Shameerhttps://www.blogger.com/profile/06903097920110814058noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-29306469591792994902013-05-01T12:56:36.009+04:002013-05-01T12:56:36.009+04:00hi, i managed to setup the client. but when i run ...hi, i managed to setup the client. but when i run the OrderServiceClientTest.java as junit, im getting log4j:WARN No appenders could be found for logger (org.springframework.core.env.StandardEnvironment).<br />log4j:WARN Please initialize the log4j system properly.<br />log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.<br /><br />where did i go wrong?chrizonlinehttps://www.blogger.com/profile/16542954187386301584noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-3668380562690413732012-12-03T09:35:01.511+04:002012-12-03T09:35:01.511+04:00Hi Rajesh,
I have faced the similar issue while d...Hi Rajesh,<br /><br />I have faced the similar issue while developing java client for the .Net webservice and have added below lines then it got rid of my problem, i hope it will help u.<br /><br />SoapActionCallback soapActionCallback = new SoapActionCallback ("http://uri/contextpath(or)ServiceName/Operation");<br /> SomeResponse getResponse = (SomeResponse)webServiceTemplate.marshalSendAndReceive(reqObj, soapActionCallback);<br /><br />Thanks,<br />GangadharGangadharhttps://www.blogger.com/profile/04612836611035948173noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-54875680019449664222012-06-19T16:46:53.262+04:002012-06-19T16:46:53.262+04:00Hi Sameer ,
There are no errors in the server con...Hi Sameer ,<br /><br />There are no errors in the server console ,and no exception was found,please find the below lines of log where you can find the null order object.Kindly revert incase of any further information.<br /><br />18:00:57,544 INFO [STDOUT] 18:00:57,544 INFO [MessageDispatcherServlet] Servlet 'spring-ws' configured successfully<br />18:00:58,247 INFO [STDOUT] 18:00:58,247 INFO [OrderServiceImpl] Order has been cancelled with Reference : null<br />18:00:58,388 INFO [STDOUT] 18:00:58,388 INFO [OrderServiceImpl] Order has been placed. Order Info is :Anonymoushttps://www.blogger.com/profile/12136700121974052662noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-15751693836924076752012-06-18T18:22:19.902+04:002012-06-18T18:22:19.902+04:00Is your server console or lg file shows any trace ...Is your server console or lg file shows any trace or error message of the client call ?Shameerhttps://www.blogger.com/profile/06903097920110814058noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-74123716524822094552012-06-18T14:46:14.783+04:002012-06-18T14:46:14.783+04:00Hi Sameer,
we have implemented the service and cl...Hi Sameer,<br /><br />we have implemented the service and client example and could get the wsdl. But when invoking the service from the client the end point is getting null instead of marshalled request object. Can you please throw some light where exactly we need to correct.Anonymoushttps://www.blogger.com/profile/12136700121974052662noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-71805223444079710582012-05-13T22:58:48.722+04:002012-05-13T22:58:48.722+04:00hi, thanks for this tutorial,
Please I need to imp...hi, thanks for this tutorial,<br />Please I need to implement a client program that interact with Open Travel Alliance (OTA)"I mean I need to send requests to a GDS(Global Distribution Service) via OTA " but I am such a beginner that I am confused and I don't know what to do, can you please give me some steps to follow<br />any suggestions are extremely appreciated.amalEspoirehttps://www.blogger.com/profile/13545959009355637075noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-12866208102894471022012-04-05T13:37:14.603+04:002012-04-05T13:37:14.603+04:00thanks Sameer for the tutorial.I have got the app ...thanks Sameer for the tutorial.I have got the app working except for test case which is failing.I am not getting the response, but i am able to set request.Pls helpAnonymoushttps://www.blogger.com/profile/05045218926975808497noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-87468829316238301492012-04-04T10:59:05.522+04:002012-04-04T10:59:05.522+04:00Hi, thanks for tutorial:
i am getting java.lang.C...Hi, thanks for tutorial:<br /><br />i am getting java.lang.ClassCastException: javax.xml.bind.JAXBElement cannot be cast<br />any idea about why i am getting this errorAnonymoushttps://www.blogger.com/profile/05045218926975808497noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-24635983287262694152012-02-16T19:45:55.069+04:002012-02-16T19:45:55.069+04:00hi and thanks for this great tutorial.
i'm fa...hi and thanks for this great tutorial.<br /><br />i'm facing an issue here. i get:<br />- "org.xml.sax.SAXParseException: XML document structures must start and end within the same entity" when using SaajSoapMessageFactory<br />- "org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element" when using AxiomSoapMessageFactory<br /><br />unfortunately i can't put my hands on the server side.<br />i was basically just asked to build a client for this wsdl.<br /><br />any help will be much appreciatedAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-33658738533481010252012-01-21T08:24:00.610+04:002012-01-21T08:24:00.610+04:00Many have requested for the classpath dependencies...Many have requested for the classpath dependencies for the project. Here are the jar files I have added into the classpath, for the service project. Most of them are available from the Spring download(with dependencies) archive.<br /><br /><br />aopalliance-1.0.jar<br />commons-logging-1.1.1.jar<br />log4j-1.2.9.jar<br />spring-aop-3.0.5.RELEASE.jar<br />spring-asm-3.0.5.RELEASE.jar<br />spring-beans-3.0.5.RELEASE.jar<br />spring-context-3.0.5.RELEASE.jar<br />spring-context-support-3.0.5.RELEASE.jar<br />spring-core-3.0.5.RELEASE.jar<br />spring-expression-3.0.5.RELEASE.jar<br />spring-oxm-3.0.5.RELEASE.jar<br />spring-web-3.0.5.RELEASE.jar<br />spring-webmvc-3.0.5.RELEASE.jar<br />spring-ws-core-2.0.1.RELEASE.jar<br />spring-xml-2.0.1.RELEASE.jar<br />wsdl4j-1.6.1.jarShameerhttps://www.blogger.com/profile/06903097920110814058noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-56984956794117136902012-01-21T07:07:19.464+04:002012-01-21T07:07:19.464+04:00Hi All,
This article is great. But I am facing a ...Hi All,<br /><br />This article is great. But I am facing a problem because I have two different namespaces. My schema and definition are kept in different namespaces.<br /> For that I have defined my marshaller as follows using the property <br />contextPaths in the applicationContext.xml: specifying the two paths of the java packages generated by JAXB.<br /><br />Yet, my marshaller gives me bind exception." missing an @XmlRootElement annotation" .<br /><br />Can anyone please help me on this ? <br /><br />Thanks in advance.<br />Priyanka<br /> In the As a result my marshaller is failing. Gives me @XmlRootElementPriyankahttps://www.blogger.com/profile/04779413515547743886noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-19495603748868917392011-11-22T03:12:07.938+04:002011-11-22T03:12:07.938+04:00Hi Shameer,
Thanks for the great tutorial. I am l...Hi Shameer,<br /><br />Thanks for the great tutorial. I am learning spring by reading your blog. While using your code I getting this error.<br /><br />Following import statement can not be resolved<br /><br />import org.springframework.context.support.ClassPathXmlApplicationContext;<br /><br />I expect all spring related jar should be included in STS IDE. Do I need to include any jar in lib folder? <br /><br />Please help.Feed for Thoughthttps://www.blogger.com/profile/03110533937106467096noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-62573649394309989112011-11-21T15:43:25.067+04:002011-11-21T15:43:25.067+04:00I am getting the below error. Pls give me the reso...I am getting the below error. Pls give me the resolution.<br />org.springframework.ws.client.WebServiceTransportException: Not Found [404]Vanduuhttps://www.blogger.com/profile/09513787227712965926noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-14940083798197806152011-07-29T01:49:46.062+04:002011-07-29T01:49:46.062+04:00Shameer,
Is there a way i can retrieve the request...Shameer,<br />Is there a way i can retrieve the request SOAP xml using Unmarshaller may be. It requires a Source object and i am not what that is.Nilayhttps://www.blogger.com/profile/06348114049975444999noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-1249534183811454522011-07-29T00:31:44.219+04:002011-07-29T00:31:44.219+04:00Hi Shameer,
Thanks for the great tutorials. Can yo...Hi Shameer,<br />Thanks for the great tutorials. Can you also provide pointers/code to call the actual Endpoint from the client; a main() method may be.<br /><br />Thanks again.<br />NilayNilayhttps://www.blogger.com/profile/06348114049975444999noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-26137155980170002922011-07-27T19:53:58.670+04:002011-07-27T19:53:58.670+04:00Thanks shameer, it has something to do with URL, y...Thanks shameer, it has something to do with URL, your pointers in that direction worked. Also, implemented security for the the same. Now I am trying to use an AXIS2 client to access the service.... it works fine without security, with security I have no idea how to add the security header in the request from AXIS2 client, please help.<br /><br />Thanks in advance.Lokeshhttps://www.blogger.com/profile/10571230789675078557noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-47620611969256148152011-07-27T11:27:37.573+04:002011-07-27T11:27:37.573+04:00@Lokesh,
It looks like a URL problem, can you che...@Lokesh,<br /><br />It looks like a URL problem, can you check if the URL follows the pattern, http://<ip-address>:<port>/<context-root>/spring-ws/<Service-Name> ?<br /><br />a sample URL is --<br />http://localhost:8080/LiveRestaurant/spring-ws/OrderService<br /><br />??Shameerhttps://www.blogger.com/profile/06903097920110814058noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-10974736278975974752011-07-23T04:14:50.167+04:002011-07-23T04:14:50.167+04:00Hello Shamer,
Thank you very much for an easy to ...Hello Shamer,<br /><br />Thank you very much for an easy to follow tutorial. I got the sample working but when I try the same with my project, I see the wsdl published.. when I run the client i get 404, Please help me fix the issue. <br /><br />Please let me know what information needed.<br /><br />Thanks in advance.<br /><br />LokeshLokeshhttps://www.blogger.com/profile/10571230789675078557noreply@blogger.comtag:blogger.com,1999:blog-1117705343685907636.post-34857227721888664032011-05-27T01:37:36.642+04:002011-05-27T01:37:36.642+04:00Laxman,
You may configure Log4J for the service a...Laxman,<br /><br />You may configure Log4J for the service app, and set the log level to debug, then you can see the MessageDispatcher logs the incoming SOAP request and the outgoing SOAP response.<br /><br />Easy way to configure Log4J, is these four steps.<br />1) Add log4j jar file into your classpath/project<br />2) Add a context-param in the web.xml, name = log4jConfigLocation, value = /WEB-INF/log4j.properties<br />3) Add a log4j.properties file into the WEB-INF folder<br />4) Add property, log4j.logger.org.springframework=DEBUG<br />in the lof4j.properties<br /><br />Rebuild, redeploy the app, run the client program again, you should see the message in the console, among other spring debug messages.Shameerhttps://www.blogger.com/profile/06903097920110814058noreply@blogger.com