axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Flores, Raul" <raul.flo...@lmco.com>
Subject RE: swaRef URI initialization "Whats the right WSDL for MIME"
Date Mon, 30 Aug 2004 15:21:30 GMT
Yes it should (http://www.ws-i.org/profiles/basic/1.1/swaref.xsd), but I
have had some touble with the import (firewalls I guess). I was trying
to keep the wsdl as close to possible with the published example. That
said, I have attached a wsdl which does not use the import statement.

Also, my build file assumes you are working in the current directory
(CD) with the wsdl file, and in the CD there is a directory for src,
dist, and web.  The web direcotry contains:

Web -
    WEB-INF
        classes
        lib (axis libraries and JAF and mail)

Things get built under a CD/build directory.

When I try and build this and query axis for the wsdl, It does not give
be back any of the mime parts in the binding section


Thanks,
Raul

-----Original Message-----
From: Jim Murphy [mailto:jmurphy@mindreef.com] 
Sent: Monday, August 30, 2004 9:27 AM
To: axis-user@ws.apache.org
Subject: Re: swaRef URI initialization "Whats the right WSDL for MIME"


I'm assuming the SwA Ref XSD document is at the location specified in 
the xsd:import.


...
<xsd:import namespace="http://ws-i.org/profiles/basic/1.1/xsd" 
schemaLocation="wsi-bp1.1.xsd" />
...

Jim


Hector Flores wrote:

> Yes. It is defined as you suggested.
> I am using Cape Clear SOA editor, and the wsdl validates. I am also
> using apache axis 1.2 beta 2 to generate server side and client side 
> stubs (with tomcat 5.0.19).
> I will attach wsdl, and my client.
> 
> Thanks for your help Ann. I always take time to read yours and dims
> responses. Thanks for posting to this list.
> 
> 
> Thanks,
> (hector) Raul
> 
> Anne Thomas Manes wrote:
> 
>> Did you define an element in your types section called "ClaimDetail"?
>>
>> It should be defined as:
>>
>> <xsd:element name="ClaimDetail" type="types:ClaimDetailType"/>
>>
>> Anne
>>
>> ---------------------------------------------------------------------
>> ---
>>
>> *From:* Hector Flores [mailto:hector.flores@verizon.net]
>> *Sent:* Friday, August 27, 2004 5:51 PM
>> *To:* Axis Users Group
>> *Subject:* swaRef URI initialization "Whats the right WSDL for MIME"
>>
>> I am trying to do attachments via the recent AP 1.0 SwA profile but
>> need some help in creating the URI object.
>> Not sure what to do here.
>>
>> I am using the wsdl for doc/literal which was previously posted on
>> this site for "What's the right WSDL for MIME" (also found in the AP
1.0)
>>
>>            <xsd:complexType name="ClaimDetailType">
>>
>>                <xsd:sequence>
>>
>>                    <xsd:element name="Name" type="xsd:string"/>
>>
>>                    <xsd:element name="ClaimForm" type="ref:swaRef"/>
>>
>>                </xsd:sequence>
>>
>>            </xsd:complexType>
>>
>>
>>
>>    <wsdl:message name="ClaimIn">
>>
>>        <wsdl:part name="body" element="types:ClaimDetail"/>
>>
>>        **<wsdl:part name="ClaimPhoto" type="xsd:base64Binary"/>**
>>
>>    </wsdl:message>
>>
>>
>>
>> Currently when I try and call the server I get an exception:
>>
>>
>>
>>     [java] upload Test:
>>
>>     [java] Exception: org.xml.sax.SAXException: Invalid element in
>> com.lmtas.swa.services.ClaimDeta
>>
>> ilType - ClaimDetail
>>
>>     [java] AxisFault
>>
>>     [java]  faultCode:
>> {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>>
>>     [java]  faultSubcode:
>>
>>     [java]  faultString: org.xml.sax.SAXException: Invalid element in
>> com.lmtas.swa.services.ClaimD
>>
>> etailType - ClaimDetail
>>
>>     [java]  faultActor:
>>
>>     [java]  faultNode:
>>
>>     [java]  faultDetail:
>>
>>     [java]     {http://xml.apache.org/axis/}hostname:raul
>>
>>
>>
>>     [java] org.xml.sax.SAXException: Invalid element in
>> com.lmtas.swa.services.ClaimDetailType - Cl
>>
>> aimDetail
>>
>>     [java]     at 
>> org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder
>> .java:223)
>>
>>
>>     [java]     at 
>> org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.
>> java:130)
>>
>>
>>     [java]     at 
>> org.apache.axis.encoding.DeserializationContextImpl.endElement(Deseri
>> alizationCon
>>
>>
>> textImpl.java:1060)
>>
>>     [java]     at 
>> org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1712)
>>
>>     [java]     at 
>> org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
>>
>>     [java]     at 
>> org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
>>
>>     [java]     at 
>> org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
>>
>>     [java]     at 
>> org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
>>
>>     [java]     at 
>> org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
>>
>>     [java]     at 
>> org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
>>
>>     [java]     at 
>> org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
>>
>>     [java]     at
javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
>>
>>     [java]     at 
>> org.apache.axis.encoding.DeserializationContextImpl.parse(Deserializa
>> tionContextI
>>
>>
>> mpl.java:218)
>>
>>     [java]     at 
>> org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:646)
>>
>>     [java]     at 
>> org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
>>
>>     [java]     at 
>> org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnders
>> tandChecker.
>>
>>
>> java:62)
>>
>>     [java]     at 
>> org.apache.axis.client.AxisClient.invoke(AxisClient.java:173)
>>
>>     [java]     at 
>> org.apache.axis.client.Call.invokeEngine(Call.java:2735)
>>
>>     [java]     at org.apache.axis.client.Call.invoke(Call.java:2718)
>>
>>     [java]     at org.apache.axis.client.Call.invoke(Call.java:2394)
>>
>>     [java]     at org.apache.axis.client.Call.invoke(Call.java:2317)
>>
>>     [java]     at org.apache.axis.client.Call.invoke(Call.java:1774)
>>
>>     [java]     at 
>> com.lmtas.swa.client.SWAServiceBindingStub.sendClaim(SWAServiceBindin
>> gStub.java:1
>>
>>
>> 60)
>>
>>     [java]     at swaClientTest.main(swaClientTest.java:39)
>>
> 
> 
> ----------------------------------------------------------------------
> --
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions
>     name="SWAService"
>     targetNamespace="http://com.lmtas.swa.services"
>     xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
>     xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd"
>     xmlns:soapbind="http://schemas.xmlsoap.org/wsdl/soap/"
>     xmlns:tns="http://com.lmtas.swa.services"
>     xmlns:types="http://com.lmtas.swa.services"
>     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>     <wsdl:documentation
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">RAUL FLORES
SERVICE</wsdl:documentation>
>     <wsdl:types>
>         <xsd:schema
>             targetNamespace="http://com.lmtas.swa.services"
>             xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>             <!-- <xsd:import
namespace="http://ws-i.org/profiles/basic/1.1/xsd"/> -->
>             <xsd:import
>                 namespace="http://ws-i.org/profiles/basic/1.1/xsd"
>                 schemaLocation="wsi-bp1.1.xsd"/>
>             <xsd:element name="ClaimRefNo" type="xsd:string"/>
>             <xsd:complexType name="ClaimDetailType">
>                 <xsd:sequence>
>                     <xsd:element name="Name" type="xsd:string"/>
>                     <xsd:element name="ClaimForm" type="ref:swaRef"/>
>                 </xsd:sequence>
>             </xsd:complexType>
>             <xsd:element name="ClaimDetail"
type="types:ClaimDetailType"/>
>         </xsd:schema>
>     </wsdl:types>
>     <wsdl:message name="ClaimOut">
>         <wsdl:part element="tns:ClaimRefNo" name="out"/>
>     </wsdl:message>
>     <wsdl:message name="ClaimIn">
>         <wsdl:part element="tns:ClaimDetail" name="body"/>
>         <wsdl:part name="ClaimPhoto" type="xsd:base64Binary"/>
>     </wsdl:message>
>     <wsdl:portType name="SWAServicePortType">
>         <wsdl:documentation
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">All the
operations</wsdl:documentation>
>         <wsdl:operation name="SendClaim">
>             <wsdl:documentation
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">This operation does have
an attachment with it</wsdl:documentation>
>             <wsdl:input message="tns:ClaimIn"/>
>             <wsdl:output message="tns:ClaimOut"/>
>         </wsdl:operation>
>     </wsdl:portType>
>     <wsdl:binding name="SWAServiceBinding"
type="tns:SWAServicePortType">
>         <soapbind:binding
>             style="document"
>             transport="http://schemas.xmlsoap.org/soap/http"/>
>         <wsdl:operation name="SendClaim">
>             <soapbind:operation
>
soapAction="capeconnect:SWAService:SWAServicePortType#SendClaim"/>
>             <wsdl:input>
>                 <mime:multipartRelated>
>                     <mime:part>
>                         <soapbind:body parts="body" use="literal"/>
>                     </mime:part>
>                     <mime:part>
>                         <mime:content part="ClaimPhoto"
type="application/octet-stream"/>
>                     </mime:part>
>                 </mime:multipartRelated>
>             </wsdl:input>
>             <wsdl:output>
>                 <soapbind:body use="literal"/>
>             </wsdl:output>
>         </wsdl:operation>
>     </wsdl:binding>
>     <wsdl:service name="SWAService">
>         <wsdl:documentation
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">SWA Service documentation
HECTOR RAUL FLORES</wsdl:documentation>
>         <wsdl:port binding="tns:SWAServiceBinding"
name="SWAServicePort">
>             <soapbind:address
location="http://raul:8080/swa/SWAService"/>
>         </wsdl:port>
>     </wsdl:service>
> </wsdl:definitions>
> 
> 
> ----------------------------------------------------------------------
> --
> 
> import com.lmtas.swa.client.*;
> 
> import org.apache.axis.attachments.*;
> import javax.mail.internet.MimeMultipart;
> import javax.activation.*;
> import com.lmtas.swa.client.*;
> 
> import java.io.*;
> import java.lang.*;
> import java.util.*;
> 
> public class swaClientTest {
> 
>   public swaClientTest() {
>   }
> 
>   public static void main(String[] args) {
> 
>     System.out.println("\n\nswaClientTest: MAIN\n");
>     try {
> 
>       SWAServiceLocator locator = new SWAServiceLocator();
>
locator.setSWAServicePortEndpointAddress("http://localhost:8080/swa/serv
ices/SWAServicePort");
>       SWAServiceBindingStub stub = (SWAServiceBindingStub)
locator.getSWAServicePort();
>       //stub.setMaintainSession(true);
> 
>       System.out.println("upload Test: ");
> 
>       org.apache.axis.types.URI uri = new
org.apache.axis.types.URI("cid","ClaimPhoto@lmtas.com");
>       com.lmtas.swa.client.ClaimDetailType cdt = new
ClaimDetailType("Hello",uri);
>       DataHandler Dh = new DataHandler( new
FileDataSource("C:/readme.txt"));
>       String refNo = stub.sendClaim (cdt,Dh);
> 
>     }
>     catch (Exception e) {
> 
>       System.out.println("Exception: " + e.getMessage());
>       e.printStackTrace();
> 
>     }
>   }
> }

Mime
View raw message