Howto not mess up response when using Call.setHandler
Hi all, I’m trying to implement authentication in my web service. I’ve changed my client to include security information in the message by following an example from http://axis-wsse.sourceforge.net/. Essentially, the client sets up a handler on the call which appends the security information. I haven’t changed the server side of things yet, as I wanted to see the client work first. When I run my client without setting up the handler everything is fine – and it gets a result back from the server that it can deserialize and write out. When I setup the handler, I can see (with tcpmon) that the security information is added in the client’s message and that the server (ignores it and) returns a message like in the above case. Unfortunately I’m getting the below exception when the client gets back the message from the server. I’m suspecting that setting up the handler for the request message somehow messes up the handling of the response. The handler is setup with Call.setHandler(request, response) which takes both a handler for the request and the response. A just set the response handler to null – as this is done in the example I’ve copied. Does anyone know if this is the correct way, to set up the handler? Best, Morten - Exception: org.xml.sax.SAXException: Deserializing parameter 'newProfileReturn': could not find deserializer for type {http://encoding.ws.io.udps.unwire.dk}SerializableProfile at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:302) at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:963) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:722) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:347) at org.apache.axis.client.Call.invoke(Call.java:2272) at org.apache.axis.client.Call.invoke(Call.java:2171) at org.apache.axis.client.Call.invoke(Call.java:1691) at dk.unwire.udps.io.ws.client.ProfileSoapBindingStub.newProfile(ProfileSoapBindingStub.java:182) at dk.unwire.udps.io.ws.client.WSClientProfileFactory.newProfile(WSClientProfileFactory.java:198) at WSTest.main(WSTest.java:38) - There was an error invoking the web service AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: org.xml.sax.SAXException: Deserializing parameter 'newProfileReturn': could not find deserializer for type {http://encoding.ws.io.udps.unwire.dk}SerializableProfile faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXException: Deserializing parameter 'newProfileReturn': could not find deserializer for type {http://encoding.ws.io.udps.unwire.dk}SerializableProfile at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:302) at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:963) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:722) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:347) at org.apache.axis.client.Call.invoke(Call.java:2272) at org.apache.axis.client.Call.invoke(Call.java:2171) at org.apache.axis.client.Call.invoke(Call.java:1691) at dk.unwire.udps.io.ws.client.ProfileSoapBindingStub.newProfile(ProfileSoapBindingStub.java:182) at dk.unwire.udps.io.ws.client.WSClientProfileFactory.newProfile(WSClientProfileFactory.java:198) at WSTest.main(WSTest.java:38) org.xml.sax.SAXException: Deserializing parameter 'newProfileReturn': could not find deserializer for type {http://encoding.ws.io.udps.unwire.dk}SerializableProfile at org.apache.axis.AxisFault.makeFault(AxisFault.java:129) at org.apache.axis.client.Call.invoke(Call.java:2275) at org.apache.axis.client.Call.invoke(Call.java:2171) at org.apache.axis.client.Call.invoke(Call.java:1691) at dk.unwire.udps.io.ws.client.ProfileSoapBindingStub.newProfile(ProfileSoapBindingStub.java:182) at dk.unwire.udps.io.ws.client.WSClientProfileFactory.newProfile(WSClientProfileFactory.java:198) at WSTest.main(WSTest.java:38) Caused by: org.xml.sax.SAXException: Deserializing parameter 'newProfileReturn': could not find deserializer for type {http://encoding.ws.io.udps.unwire.dk}SerializableProfile at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:302) at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:963)
Java Client, .NET server... and the Oreilly book...
So, has anyone actually written a web service client that can communicate with a .NET server? I'd love proof that it can be done. So far I've seen references to things the other way around, and pointers to classes that don't actually exist in the 1.1 axis jar. I suppose most people using axis are written services, and I look forward to doing that myself, but right now, it's clients, and what I need to talk to is a Microsoft SharePoint server... My only working code so far is based on the classes generated from WSDL2Java for a public exchange rate service. No security involved. Create a service, get an endpoint, get a call, add some parameters, invoke the call. What am I suppose to do with a with a "Sender"? On that note, anyone know what's up with the programming axis book from Oreilly? I pre-ordered it from amazon, but its not been listed as available yet, and I could not find it on oreilly's site.
Re: Simple question....
Hi Elaine, I've got a similar problem to Dan, and haven't seen any great answers posted to date... I'm doing some R&D on 'secure' federated resource discovery using SAML to pass attributes about the principal to a bunch of repositories along with their query. So far, so good. I have a nice federated search client that can talk SRW & SAML, and signs its messages. (If you send SAML assertions, you really must sign them). The only thing is, my search client also needs to be able to cross-search repositories that are open access. In this case, the client has to be configured such that if a target is known to support digital signatures, it must sign the message (and expect a signed response), whereas if the target is open-access, the message exchange goes vanilla. If I sign my messages to 'vanilla' targets they reject my request (not understanding my "MustUnderstand" - even if they do somehow fail to notice this problem, I reject their responses as they don't have a required security header). I've been using WSS4J to handle signing, configured via the client-config.wsdd file. I'd rather manage this in the configuration properties than coding it into the client. But if the only answer is to make my classes smart enough to programmatically sort out WSS4J, then so be it... - Scott On 25 Mar 2005, at 04:00, Elaine Nance wrote: Dan, Here are also simple questions, not particularly aimed at you: Why would your service be responsible for what the subscriber does to handle the responses? If the interface is fully specified by the wsdl then the client will be able to consume it. What, specifically, are you doing that you need to concern yourself with client-side handlers? I'm not being a smartie here. I see a lot of posts similar to yours and I wonder why: 1) the provider wants to be responsible for the subscriber - frankly I'd love it if our enterprise IT even *thought* about providing usable client code. I will absolutely settle for a wsdl which doesn't make me hand-code parsers for every string-wrapped xml document. 2) so many services don't seem to be designed as services - it's as if the cart is driving the horse, as in "we already have the application/interfaces/classes that we'd like to expose as a web service" . . . 3) SOAP is decided as the solution when the problem hasn't been analyzed Elaine Dan O'Neill wrote: I'm tired trying to get them to work. Do Client-side service-specific handlers work? If you put them in client-config.wsdd? I know that if I change them to global they work? I've got some working by using setClientHandlers() in the client code but I don't always have the luxury of changing people's java client? <~~ | Computers are useless. They can only give you answers. | -- Pablo Picasso -- <~~ smime.p7s Description: S/MIME cryptographic signature
Problem running sample examples
Hi I tried to run sample examples described in axis-1_2beta3 documentation user-guide. here it is the output i got. it says "tools.jar" is missed. how can i find it. or has any error occured? I have set all the classpaths correctlly. These are the two examples i tried. INPUT C:\axis-1_2beta3>java -cp %AXISCLASSPATH% samples.userguide.example3.Client -lhttp://localhost:8080/axis/services/MyService "test me!" OUTPUT log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle). log4j:WARN Please initialize the log4j system properly. The AXIS engine could not find a target service to invoke! targetService is MyService INPUT C:\axis-1_2beta3>java -cp %AXISCLASSPATH% samples.userguide.example2.CalcClient -p8080 add 10 10 OUTPUT log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectR esourceBundle). log4j:WARN Please initialize the log4j system properly. Exception in thread "main" AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.RuntimeException: No compiler found in your classpath! (you may need to add 'tools.jar') faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.RuntimeException: No compiler found in your classpath! (you may need to add 'tools.jar') faultActor: faultNode: faultDetail: java.lang.RuntimeException: No compiler found in your classpath! (you may need to add 'tools.jar') at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder .java:223) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder. java:130) at org.apache.axis.encoding.DeserializationContextImpl.endElement(Deseri alizationContextImpl.java:1053) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source ) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow n Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent Dispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at org.apache.axis.encoding.DeserializationContextImpl.parse(Deserializa tionContextImpl.java:218) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:568) at org.apache.axis.Message.getSOAPEnvelope(Message.java:427) at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.j ava:701) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:93) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg y.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:144) at org.apache.axis.client.Call.invokeEngine(Call.java:2688) at org.apache.axis.client.Call.invoke(Call.java:2671) at org.apache.axis.client.Call.invoke(Call.java:2357) at org.apache.axis.client.Call.invoke(Call.java:2280) at org.apache.axis.client.Call.invoke(Call.java:1741) at samples.userguide.example2.CalcClient.main(CalcClient.java:59) java.lang.RuntimeException: No compiler found in your classpath! (you may need to add 'tools.jar') at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder .java:223) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder. java:130) at org.apache.axis.encoding.DeserializationContextImpl.endElement(Deseri alizationContextImpl.java:1053) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source ) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow n Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent Dispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at org.apache.axis.encoding.DeserializationContextImpl.parse(Deserializa tionContextImpl.java:218)
Getting StackOverflow error while trying to invoke the service
Title: Getting StackOverflow error while trying to invoke the service I do have cyclic loops at some places. Any idea how to prevent this? See the WSDL below. I have highlighted the suspected places in red. Thanks Dheeraj http://services.hrs.harris.com/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://services.hrs.harris.com/" xmlns:intf="http://services.hrs.harris.com/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://services.hrs.harris.com/" xmlns:content="http://content.services.hrs.harris.com/" xmlns:media="http://media.services.hrs.harris.com/" xmlns:device="http://device.services.hrs.harris.com/" xmlns:storage="http://storage.services.hrs.harris.com/" xmlns:timecode="http://timecode.services.hrs.harris.com/" xmlns:config="http://config.services.hrs.harris.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> http://timecode.services.hrs.harris.com/" xmlns="http://www.w3.org/2001/XMLSchema"> http://media.services.hrs.harris.com/" xmlns="http://www.w3.org/2001/XMLSchema"> http://content.services.hrs.harris.com/" xmlns="http://www.w3.org/2001/XMLSchema"> http://device.services.hrs.harris.com/" xmlns="http://www.w3.org/2001/XMLSchema"> http://services.hrs.harris.com/" xmlns="http://www.w3.org/2001/XMLSchema"> http://schemas.xmlsoap.org/soap/encoding/" /> http://storage.services.hrs.harris.com/" xmlns="http://www.w3.org/2001/XMLSchema"> http://schemas.xmlsoap.org/soap/http" style="document" /> http://localhost:8080/hrsApp/services/ContentServiceWS"/>
RE: Re: can I use Axis for this?
AXIS does this too, there was a post a couple of days (a week? 10 days?) ago on this. Also XMLBeans And Castor And one other I forget -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Tim K. (Gmane) Sent: Tuesday, March 29, 2005 6:42 PM To: axis-user@ws.apache.org Subject: Re: can I use Axis for this? Have you looked at this: http://java.sun.com/j2se/1.4.2/docs/api/java/beans/XMLDecoder.html http://java.sun.com/j2se/1.4.2/docs/api/java/beans/XMLEncoder.html Or JAXB http://java.sun.com/xml/jaxb/ Tim [EMAIL PROTECTED] wrote: > > Greetings list, > > I need to deserialize xml file to java objects, could anyone give me > some suggestions? Can I use axis for this purpose? > > Once a xml file is parsed to a DOM tree, is there a nice tool to use > to get the object(s) if the Class is given? I'm thinking that a tool > should be able to figure it out how to populate the java object using > reflection when having the DOM tree. Your suggestions will be appreciated! > > Thanks > > Richard > >
Re: can I use Axis for this?
Have you looked at this: http://java.sun.com/j2se/1.4.2/docs/api/java/beans/XMLDecoder.html http://java.sun.com/j2se/1.4.2/docs/api/java/beans/XMLEncoder.html Or JAXB http://java.sun.com/xml/jaxb/ Tim [EMAIL PROTECTED] wrote: Greetings list, I need to deserialize xml file to java objects, could anyone give me some suggestions? Can I use axis for this purpose? Once a xml file is parsed to a DOM tree, is there a nice tool to use to get the object(s) if the Class is given? I'm thinking that a tool should be able to figure it out how to populate the java object using reflection when having the DOM tree. Your suggestions will be appreciated! Thanks Richard
can I use Axis for this?
Title: can I use Axis for this? Greetings list, I need to deserialize xml file to java objects, could anyone give me some suggestions? Can I use axis for this purpose? Once a xml file is parsed to a DOM tree, is there a nice tool to use to get the object(s) if the Class is given? I'm thinking that a tool should be able to figure it out how to populate the java object using reflection when having the DOM tree. Your suggestions will be appreciated! Thanks Richard
Re: .NET cred
So, having failed miserably to create anything in a java/client that does microsoft flavor security I decided to go active basic auth on IIS. All of the following control widgets from inetmgr had check boxes to allow basic auth. I checked 'em all. I'm still getting: faultString: (401)Unauthorized as a reply. I'd love to compare notes with anyone who has successfully talked to any Microsoft .NET web service with apache axis... HOSTNAME Web Sites Default Web Site _vti_bin BIN\STSOAP.DLL _VTI_ADM\ADMIN.DLL _VTI_AUT\AUTHOR.DLL _wpresources\web.config wpresources\web.config _vti_pvt\service.cnf _vti_pvt\services.cnf
Re: .NET cred
Would this also work for digest authentication for example? Also, how do you get to use CommonsHTTPSender when you need to make a call given an instance of the Stub? Thanks. Tim THOMAS, JAI [AG-Contractor/1000] wrote: Have a look at org.apache.axis.transport.http.CommonsHTTPSender. ComonsHTTPSender::invoke() appends user credentials and other relevant info to http header before sending request. Hope it helps Jai -Original Message- From: John Windberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 29, 2005 12:57 PM To: axis-user@ws.apache.org Subject: RE: .NET cred CommonsHTTPSender() does not seem to exist anywhere in the axis.jar file. I'll admit to being clueless, but you have to start somewhere. To quote someone great, "Huh?" thanks I'm sure somewhere out there is a howto or a faq or something on how one uses java/axis to talk to a .NET server that has not been changed in anyway from it's default settings. Anyone?? Thanks -J
My blog is back online
For anyone that's interested, my blog is back online. See http://atmanes.blogspot.com/.
RE: .NET cred
I unjarred axis.jar and there is no org.apache.axis.transport.http.CommonsHTTPSender just org.apache.axis.transport.http.HTTPSender Is that the same thing? --- "THOMAS, JAI [AG-Contractor/1000]" <[EMAIL PROTECTED]> wrote: > Have a look at > org.apache.axis.transport.http.CommonsHTTPSender. > ComonsHTTPSender::invoke() appends user credentials > and other relevant info > to http header before sending request. > > Hope it helps > > Jai > > > > > -Original Message- > From: John Windberg [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 29, 2005 12:57 PM > To: axis-user@ws.apache.org > Subject: RE: .NET cred > > > CommonsHTTPSender() does not seem to exist anywhere > in > the axis.jar file. > > I'll admit to being clueless, but you have to start > somewhere. > > To quote someone great, "Huh?" > > thanks > > I'm sure somewhere out there is a howto or a faq or > something on how one uses java/axis to talk to a > .NET > server that has not been changed in anyway from it's > default settings. Anyone?? > > Thanks > > -J >
RE: .NET cred
Have a look at org.apache.axis.transport.http.CommonsHTTPSender. ComonsHTTPSender::invoke() appends user credentials and other relevant info to http header before sending request. Hope it helps Jai -Original Message- From: John Windberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 29, 2005 12:57 PM To: axis-user@ws.apache.org Subject: RE: .NET cred CommonsHTTPSender() does not seem to exist anywhere in the axis.jar file. I'll admit to being clueless, but you have to start somewhere. To quote someone great, "Huh?" thanks I'm sure somewhere out there is a howto or a faq or something on how one uses java/axis to talk to a .NET server that has not been changed in anyway from it's default settings. Anyone?? Thanks -J
RE: .NET cred
CommonsHTTPSender() does not seem to exist anywhere in the axis.jar file. I'll admit to being clueless, but you have to start somewhere. To quote someone great, "Huh?" thanks I'm sure somewhere out there is a howto or a faq or something on how one uses java/axis to talk to a .NET server that has not been changed in anyway from it's default settings. Anyone?? Thanks -J
RE: .NET cred
I'm expecting to not have much control over the given sharepoint server, so doing whatever it does would be the correct answer. Can you point me to any scrap of code on how to do NTLM with axis as a client or a readme? Thanks heaps. -J --- Simon Fell <[EMAIL PROTECTED]> wrote: > Sharepoint by default uses NTLM auth. > > I believe if you switch to using commonsHTTPSender, > it supports NTLM, or > you can chanage your sharepoint config to allow > basic auth as well. > > Cheers > simon > > > -Original Message- > > From: John Windberg [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, March 29, 2005 10:11 AM > > To: axis-user@ws.apache.org > > Subject: Re: .NET cred > > > > I suppose I should have been a bit more clear. > > I'm programming a client in Java, with Axis. > > > > basic auth with setUserName and setPassword don't > work when > > accessing a .NET server, and in Java there is no > > service.Credential to work with. > > What's the trick? > > > > My code so far... > > > > ListsLocator service = new ListsLocator(); Call > call = (Call) > > service.createCall(); URL url = new > > URL(service.getListsSoapAddress()); > > ListsSoapStub stub = new ListsSoapStub(url, > service); > > > _GetListCollectionResponse_GetListCollectionResult > > listCollection = stub.getListCollection(); > > > > > > >
RE: .NET cred
Sharepoint by default uses NTLM auth. I believe if you switch to using commonsHTTPSender, it supports NTLM, or you can chanage your sharepoint config to allow basic auth as well. Cheers simon > -Original Message- > From: John Windberg [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 29, 2005 10:11 AM > To: axis-user@ws.apache.org > Subject: Re: .NET cred > > I suppose I should have been a bit more clear. > I'm programming a client in Java, with Axis. > > basic auth with setUserName and setPassword don't work when > accessing a .NET server, and in Java there is no > service.Credential to work with. > What's the trick? > > My code so far... > > ListsLocator service = new ListsLocator(); Call call = (Call) > service.createCall(); URL url = new > URL(service.getListsSoapAddress()); > ListsSoapStub stub = new ListsSoapStub(url, service); > _GetListCollectionResponse_GetListCollectionResult > listCollection = stub.getListCollection(); > > >
RE: .NET cred
I don't know anything about the Lavadora plugin -Original Message- From: John Windberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 29, 2005 1:15 PM To: axis-user@ws.apache.org Subject: Re: .NET cred Oh, I suppose I ought add that the existing java classes I'm using were created with the Lavadora Plugin for Eclipse. I just pointed it at http://servername/_vti_bin/lists.asmx?WSDL and there they were. That's the same as WSDL2Java isn't it? -J
Re: Problems using axis 1.1 and 1.2 with attachments
I suggest you follow the guidelines defined in the WS-I Attachments Profile. (It requires you to use literal encoding, but if you insist on using SOAP encoding, then you still ought to be able to use the special type that WS-I created to reference an attachment from your message. See http://www.ws-i.org/Profiles/AttachmentsProfile-1.0.html, section 4.4. Anne On Tue, 29 Mar 2005 17:43:54 +0200, CREMENESCU FLORIN <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to use Axis as a client for a web service with attachments. I > have several problems, but I'm not sure that they are due to axis bugs, so I > ask you for advice. > > Skim of the wsdl service description : > > The service returns general information in a classic SOAP message plus an > attached document. The attached document is referenced from the general > information by the REP field (the entire wsdl can be found at the end of the > message). > The output message has the form : > > > > > > The binding has the form : > > > > namespace="http://mynamespace"; > encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/> > > > > > > > > Somewhere in the REP_PROTECTEL_IBDF element there is an element REP > containing : > > > > > > > This element points to the attached document. > > Questions : do you see something unusual with this specification ? Are there > any reasons to encounter problems with wsdl2java and axis ? Does wsdl2java > take into account attachments ? > > First problem : Null pointer exception with axis 1.1, but ok with axis 1.2 > RC2 > We have succeeded to call the service and get the attachment using > axis 1.2RC2 but not with axis 1.1. In axis 1.1 we get the following > NullPointerException : > > java.lang.NullPointerException > at java.io.FilterInputStream.available(FilterInputStream.java:146) > at > org.apache.xerces.impl.XMLEntityManager$RewindableInputStream.available(XMLE > ntityManager.java:2644) > at > sun.nio.cs.StreamDecoder$CharsetSD.inReady(StreamDecoder.java:487) > at > sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:448) > at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182) > at java.io.InputStreamReader.read(InputStreamReader.java:167) > at > org.apache.xerces.impl.XMLEntityScanner.load(XMLEntityScanner.java:1740) > at > org.apache.xerces.impl.XMLEntityScanner.skipSpaces(XMLEntityScanner.java:125 > 9) > at > org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(XMLD > ocumentScannerImpl.java:756) > at > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocume > ntFragmentScannerImpl.java:338) > at > org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:8 > 28) > at > org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:7 > 58) > at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:148) > at > org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:117 > 8) > at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) > at > org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationCon > textImpl.java:242) > at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538) > at org.apache.axis.Message.getSOAPEnvelope(Message.java:376) > at org.apache.axis.client.Call.invokeEngine(Call.java:2583) > at org.apache.axis.client.Call.invoke(Call.java:2553) > at org.apache.axis.client.Call.invoke(Call.java:2248) > at org.apache.axis.client.Call.invoke(Call.java:2171) > at org.apache.axis.client.Call.invoke(Call.java:1691) > > Analyzing this problem we have found that the > MultiPartRelatedInputStream in 1.2 has its definition of the method > available() : > public int available() throws java.io.IOException { > return (closed || eos) ? 0 : soapStream.available(); > } > This does not exist in axis 1.1 so the super method is used. But the > super class is initialized with a super(null) in the constructor, so > NullPointerException. > > Questions : Is it normal that the attachment part does not fonction > correctly in 1.1 or am I doing something wrong ? Are there other people > using attachments with axis ? I would like to use axis 1.1, what > possibilities I have to correct the problem (beyond patching axis) ? Is axis > 1.2 RC 2-3 stable enough to use it in a production mode ? Do you know the > release date of axis 1.2 ? > > Second problem : Wsdl2java generator > > It seems to me that the WSDL2Java generator does not treat the > attachments. The generated code of the REP class no place attribute to put > the attachment. Is this a bug or the declaration of the REP element is wrong
Re: .NET cred
Oh, I suppose I ought add that the existing java classes I'm using were created with the Lavadora Plugin for Eclipse. I just pointed it at http://servername/_vti_bin/lists.asmx?WSDL and there they were. That's the same as WSDL2Java isn't it? -J
Re: .NET cred
I suppose I should have been a bit more clear. I'm programming a client in Java, with Axis. basic auth with setUserName and setPassword don't work when accessing a .NET server, and in Java there is no service.Credential to work with. What's the trick? My code so far... ListsLocator service = new ListsLocator(); Call call = (Call) service.createCall(); URL url = new URL(service.getListsSoapAddress()); ListsSoapStub stub = new ListsSoapStub(url, service); _GetListCollectionResponse_GetListCollectionResult listCollection = stub.getListCollection();
RE: errors with WSDL2Java command
No, I think not. the problem seems to be in your WSDL file, Not in your wrapper class. What happens if you don't use the wrapper class - same result? -D -Original Message- From: Hamza Hydri [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 29, 2005 4:45 AM To: axis-user@ws.apache.org Subject: errors with WSDL2Java command Hi, I am getting errors while using WSDL2Java tool ... this is my wrapper class public class W2J_wrapper { public static void main(String[] args) { WSDL2Java.main(new String[] {"ExampleService.wsdl"}); } } Errors produced are -- log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle). log4j:WARN Please initialize the log4j system properly. java.io.IOException: Type {http://client.testcases.siemens.com}ExecResult is referenced but not defined. ExecResult is a class having methods for various tasks ... and my ExampleService.java is using these methods in its calculations. should I give the ExecResult.class in the Java classpath along with other JARs used by Axis ? Any suggestions ??? cheers
RE: getting rid of ArrayOf in WSDL
Title: getting rid of ArrayOf in WSDL http://wiki.apache.org/ws/DotNetInteropArrays From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 23, 2005 4:13 AMTo: axis-user@ws.apache.orgSubject: getting rid of ArrayOf in WSDL Sorry if this has been asked before... Is there anyway of using the Java2WSDL command to produce wrapped/literal WSDL that does NOT create separate complex types for Arrays. In other words, I would like to see (as I cannot get ArrayOf version to work with .NET client) instead of . This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately. Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce pas aux droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s) est interdite. Si vous recevez ce courrier électronique par erreur, veuillez m'en aviser immédiatement, par retour de courrier électronique ou par un autre moyen.
RE: .NET cred
Username/pw are basic auth But there is nothing that should prevent you from using this with .NET. Here's a quick refresher for how to enable this in .Net http://samples.gotdotnet.com/quickstart/aspplus/doc/secureservices.aspx The C# example you cited uses whatever the default creds are, which could be kerberos or NTLM, but is probably not applicable to a Java/AXIS client. -Dino -Original Message- From: John Windberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 29, 2005 12:16 PM To: axis-user@ws.apache.org Subject: .NET cred I'm trying to write a client to talk to the web services that are part of Microsoft SharePoint services. I've been scouring through the lists to find out how to authenticate the client, setup the credentials, whatever it is that I'm suppose to do. setUserName and setPassword are apparently "basic auth" and don't work with .NET The C# example in the Sharepoint SDK merely does this: myservice.Credentials = System.Net.CredentialCache.DefaultCredentials; Can anyone point me to a how/to, readme, or example? Thanks -J
Re: axis-based web services with netbeans 4.1 ?
Axel, Good news - that's not true. You'll need to make sure you understand Netbeans' project properties and add the axis jars to the project classpath. HTH, Elaine Axel Burwitz wrote: Hi, using eclipse as ide for my webservice programming up to now, I am thinking to switch to netbeans 4.1 as I have a very good impression of that ide's features, but some emails confused me saying that it is not possible to develop axis based web services with netbeans.. is that true ? has anyone experiences ? best regards axel <~~ | Computers are useless. They can only give you answers. | -- Pablo Picasso -- <~~
Re: .NET cred
You want to construct a System.Net.NetworkCredential, as in: service.Credentials=new System.Net.NetworkCredential("userid","pw"); Joel Rosenberger
.NET cred
I'm trying to write a client to talk to the web services that are part of Microsoft SharePoint services. I've been scouring through the lists to find out how to authenticate the client, setup the credentials, whatever it is that I'm suppose to do. setUserName and setPassword are apparently "basic auth" and don't work with .NET The C# example in the Sharepoint SDK merely does this: myservice.Credentials = System.Net.CredentialCache.DefaultCredentials; Can anyone point me to a how/to, readme, or example? Thanks -J
axis-based web services with netbeans 4.1 ?
Hi, using eclipse as ide for my webservice programming up to now, I am thinking to switch to netbeans 4.1 as I have a very good impression of that ide's features, but some emails confused me saying that it is not possible to develop axis based web services with netbeans.. is that true ? has anyone experiences ? best regards axel
Problems using axis 1.1 and 1.2 with attachments
Hello, I am trying to use Axis as a client for a web service with attachments. I have several problems, but I'm not sure that they are due to axis bugs, so I ask you for advice. Skim of the wsdl service description : The service returns general information in a classic SOAP message plus an attached document. The attached document is referenced from the general information by the REP field (the entire wsdl can be found at the end of the message). The output message has the form : The binding has the form : http://mynamespace"; encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/> Somewhere in the REP_PROTECTEL_IBDF element there is an element REP containing : This element points to the attached document. Questions : do you see something unusual with this specification ? Are there any reasons to encounter problems with wsdl2java and axis ? Does wsdl2java take into account attachments ? First problem : Null pointer exception with axis 1.1, but ok with axis 1.2 RC2 We have succeeded to call the service and get the attachment using axis 1.2RC2 but not with axis 1.1. In axis 1.1 we get the following NullPointerException : java.lang.NullPointerException at java.io.FilterInputStream.available(FilterInputStream.java:146) at org.apache.xerces.impl.XMLEntityManager$RewindableInputStream.available(XMLE ntityManager.java:2644) at sun.nio.cs.StreamDecoder$CharsetSD.inReady(StreamDecoder.java:487) at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:448) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182) at java.io.InputStreamReader.read(InputStreamReader.java:167) at org.apache.xerces.impl.XMLEntityScanner.load(XMLEntityScanner.java:1740) at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(XMLEntityScanner.java:125 9) at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(XMLD ocumentScannerImpl.java:756) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocume ntFragmentScannerImpl.java:338) at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:8 28) at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:7 58) at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:148) at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:117 8) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationCon textImpl.java:242) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538) at org.apache.axis.Message.getSOAPEnvelope(Message.java:376) at org.apache.axis.client.Call.invokeEngine(Call.java:2583) at org.apache.axis.client.Call.invoke(Call.java:2553) at org.apache.axis.client.Call.invoke(Call.java:2248) at org.apache.axis.client.Call.invoke(Call.java:2171) at org.apache.axis.client.Call.invoke(Call.java:1691) Analyzing this problem we have found that the MultiPartRelatedInputStream in 1.2 has its definition of the method available() : public int available() throws java.io.IOException { return (closed || eos) ? 0 : soapStream.available(); } This does not exist in axis 1.1 so the super method is used. But the super class is initialized with a super(null) in the constructor, so NullPointerException. Questions : Is it normal that the attachment part does not fonction correctly in 1.1 or am I doing something wrong ? Are there other people using attachments with axis ? I would like to use axis 1.1, what possibilities I have to correct the problem (beyond patching axis) ? Is axis 1.2 RC 2-3 stable enough to use it in a production mode ? Do you know the release date of axis 1.2 ? Second problem : Wsdl2java generator It seems to me that the WSDL2Java generator does not treat the attachments. The generated code of the REP class no place attribute to put the attachment. Is this a bug or the declaration of the REP element is wrong ? Also, the deserializer used for the REP object is generated as the BeanDeserializer (so I get a class cast exception when axis tries to put the AttachmentPart object in the object containing REP). I wrote a new deserializer which gets the content of the AttachmentPart and creates a REP object with this content. What bothers me is the fact that I modified the generated code (class REP_Helper). Is there a possibility to avoid this (maybe rewrite the wsdl such that wsdl2java can take into account the attachment) ? Thank you for your answers. Here is the entire wsdl : http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:wsdl="http://schemas.xmls
Invalid XML returned by Castor Serializer
Title: Invalid XML returned by Castor Serializer Has anyone used the Castor serializers for webservice methods that return typed arrays? I have a method in a wrapped style webservice that returns an array of TestData objects which I based on the classic example available at http://www-106.ibm.com/developerworks/webservices/library/ws-castor/ The method has the following signature public com.fc.timesheet.data.TestData[] getTestsAsArray() In my schema, I have defined the response as follows: My generated deploy.wsdd contains after running Java2WSDL: name="getTestsAsArray" qname="operNS:getTestsAsArray" xmlns:operNS="http://www.fortune-cookie.com/schemas/services/timesheet/wsdl" returnQName="retNS:testData[,unbounded]" xmlns:retNS="http://www.fortune-cookie.com/schemas/services/timesheet/data" returnType="rtns:testData" xmlns:rtns="http://www.fortune-cookie.com/schemas/services/timesheet/data" soapAction="" > and of course typeMappings that I changed to use the Castor serializer/deserializer. I called the webservice method using the generated SOAPBindingStub via HTTPTrace and received the following response xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> xmlns="http://www.fortune-cookie.com/schemas/services/timesheet/wsdl"> xsi:type="testData" xmlns:ns1="http://www.fortune-cookie.com/schemas/services/timesheet/data"> test1 However, I get the following exception during de-serialization of this response on the client side [java] org.xml.sax.SAXParseException: Element type "ns1:testData" must be followed by either attribute specifications, ">" or "/>". It seems to me that the [,unbounded] part of the ns1:testData element is invalid XML. This seems to be as a result of the returnQName attribute in deploy.wsdd. Does anyone know what I am doing wrong? Are there any examples of handling typed arrays for document/wrapped webservices using Castor? Thanks in advance, Patrick
errors with WSDL2Java command
Hi, I am getting errors while using WSDL2Java tool ... this is my wrapper class public class W2J_wrapper { public static void main(String[] args) { WSDL2Java.main(new String[] {"ExampleService.wsdl"}); } } Errors produced are -- log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle). log4j:WARN Please initialize the log4j system properly. java.io.IOException: Type {http://client.testcases.siemens.com}ExecResult is referenced but not defined. ExecResult is a class having methods for various tasks ... and my ExampleService.java is using these methods in its calculations. should I give the ExecResult.class in the Java classpath along with other JARs used by Axis ? Any suggestions ??? cheers
RE: Service Fails when deploying simple request and response flow handlers
Title: RE: Service Fails when deploying simple request and response flow handlers Hi Jane, sorry I am only getting back to you, this was my WSDD prior to solving the problem. http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java" xmlns:xsi="http://www.w3c.org/2000/10/XMLSchema-instance"> the service would just fail with this, but the problem was in my Handler element, Ii should have been very easy mistake to make and spot as the parameter attribute in the service Element takesm ignores the java:. Hope this helps. JP.
RE: Is it possible to have references to the same classes if I use document/literal wrapped
No, it does not, I have a similar architecture that just works fine -Message d'origine- De : Soti, Dheeraj [mailto:[EMAIL PROTECTED] Envoyé : mardi 29 mars 2005 01:54 À : 'axis-user@ws.apache.org' Objet : Is it possible to have references to the same classes if I use document/literal wrapped I have following kind of structure where this structure can be very deep. Can this cause some issues? public class Person { String name; Person friend1, friend2; } Thanks Dheeraj Soti