File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes web service integration using Netbeans IDE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "web service integration using Netbeans IDE" Watch "web service integration using Netbeans IDE" New topic
Author

web service integration using Netbeans IDE

ani bua
Greenhorn

Joined: Mar 06, 2009
Posts: 22
Hi,
i am trying to integrate a publicly available web service using Netbeans IDE . I have done the following

1. I have created the client usning Netbeans IDE
2. Drag and drop the function into the code

Now when running i am gettin the following error

SEVERE: com.sun.xml.ws.client.ClientTransportException: The server sent HTTP status code 407: Proxy Authentication Required
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.checkStatusCode(HttpTransportPipe.java:261)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.createResponsePacket(HttpTransportPipe.java:210)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:172)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:95)
at com.sun.xml.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:629)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:112)
at com.sun.enterprise.security.webservices.ClientSecurityPipe.processSecureRequest(ClientSecurityPipe.java:192)
at com.sun.enterprise.security.webservices.ClientSecurityPipe.process(ClientSecurityPipe.java:180)
at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:629)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
at com.sun.xml.ws.client.Stub.process(Stub.java:319)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:157)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:140)
at $Proxy151.latLonListCityNames(Unknown Source)
at com.my.servlets.IndexServlet.latLonListCityNames(IndexServlet.java:103)
at com.my.servlets.IndexServlet.processRequest(IndexServlet.java:53)
at com.my.servlets.IndexServlet.doPost(IndexServlet.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:662)

Please help .
Expecting early responce

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
The obvious question is: Are you behind a proxy when you are trying to contact the web service?
Can you see the WSDL of the service in a browser?
Have you tried to access the web service using soapUI? If you succeed, then the problem is with your client.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
ani bua
Greenhorn

Joined: Mar 06, 2009
Posts: 22
Yes I can access the web service from browser ..... but when i am trying to access it from code using netbeans Then there is the problem ....... can ypu provide a link where i can get sample code
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Download soapUI from here (there is a free version): http://www.soapui.org
Then try to access the web service from the client computer, but use soapUI instead of the client.
Send some requests and see if there are responses.
Best wishes!
ani bua
Greenhorn

Joined: Mar 06, 2009
Posts: 22
I have done the same and getting the reply ....... but when doing with Netbeans client and from my code getting null
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Excellent!
This means that the problem is with your client.
Post some source-code if you are able to and want help.
Best wishes!
ani bua
Greenhorn

Joined: Mar 06, 2009
Posts: 22
I have pasted the code of the Servlet file where I have drap drop the function Using NetBesans IDE.The name of the function is "latLonListCityNames" which i am call but getting null instead of the appropriate result.

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Thanks for enclosing the WSDL!
I see that the web service uses RPC/encoded, which is not supported by JAX-WS so this is the reason why soapUI works while your client does not.
A way around this problem is to use SAAJ to construct and send SOAP messages.
Also see this article that discusses this very problem: http://www.jroller.com/gmazza/entry/calling_rpc_encoded_web_services
Good luck!
ani bua
Greenhorn

Joined: Mar 06, 2009
Posts: 22
Thanks a lot . I am able to communicate data .Your guidence is just awesome .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: web service integration using Netbeans IDE