Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

"org.xml.sax.SAXException: Bad types "

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ,everyone,I use wtp-all-in-one-eclipse(eclipse+axis) created web services,and i use IBM websphere studio Application develop Integration to create BPEL.once i invoke the web service ,I got the wrong message "org.xml.sax.SAXException: Bad types (class java.lang.String -> int)"
my wsdl as the follow:<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://proty01" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://proty01" xmlns:intf="http://proty01" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->

<wsdl:message name="materialChooseRequest">

<wsdl:part name="id" type="xsd:int"/>

<wsdl:part name="material" type="xsd:int"/>

<wsdl:part name="quantity" type="xsd:int"/>

<wsdl:part name="rcdl" type="xsd:double"/>

<wsdl:part name="str" type="xsd:double"/>

<wsdl:part name="mc" type="xsd:string"/>

<wsdl:part name="price" type="xsd:double"/>

</wsdl:message>

<wsdl:message name="materialChooseResponse">

<wsdl:part name="materialChooseReturn" type="xsd:int"/>

<wsdl:part name="id" type="xsd:int"/>

<wsdl:part name="mc" type="xsd:string"/>

<wsdl:part name="price" type="xsd:double"/>

</wsdl:message>

<wsdl:portType name="MC1">

<wsdl:operation name="materialChoose" parameterOrder="id material quantity rcdl str mc price">

<wsdl:input message="impl:materialChooseRequest" name="materialChooseRequest"/>

<wsdl:output message="impl:materialChooseResponse" name="materialChooseResponse"/>

</wsdl:operation>

</wsdl:portType>

<wsdl:binding name="MC1SoapBinding" type="impl:MC1">

<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdl:operation name="materialChoose">

<wsdlsoap:operation soapAction=""/>

<wsdl:input name="materialChooseRequest">

<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://proty01" use="encoded"/>

</wsdl:input>

<wsdl:output name="materialChooseResponse">

<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://proty01" use="encoded"/>

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:service name="MC1Service">

<wsdl:port binding="impl:MC1SoapBinding" name="MC1">

<wsdlsoap:address location="http://192.168.8.87:8080/WebServices/services/MC1"/>

</wsdl:port>

</wsdl:service>

</wsdl:definitions>



myBPEL as follows:
<?xml version="1.0" encoding="UTF-8"?>
<process expressionLanguage="Java" name="MC11" suppressJoinFailure="yes"
targetNamespace="http://www.example.com/process30429325"
wpc:autoDelete="no" wpc:businessRelevant="yes"
wpc:compensationSphere="supports" wpc:displayName="MC11"
wpc:executionMode="microflow" wpc:validFrom="2003-01-01T00:00:00"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:wpc="http://www.ibm.com/xmlns/prod/websphere/business-process/v5.1/"
xmlns:wsdl="http://www.example.com/process30429325/interface"
xmlns:wsdl0="http://www.example.com/process30429325"
xmlns:wsdl1="http://proty01"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/ws/2003/03/business-process/ http://schemas.xmlsoap.org/ws/2003/03/business-process/">
<partnerLinks>
<partnerLink myRole="NewPortTypeRole" name="NewPortType" partnerLinkType="wsdl0:NewPortTypeLT"/>
<partnerLink name="MC1" partnerLinkType="wsdl0:MC1LT" partnerRole="MC1Role"/>
</partnerLinks>
<variables>
<variable messageType="wsdl:NewOperationRequest" name="proReq"/>
<variable messageType="wsdl:NewOperationResponse" name="proResp"/>
<variable messageType="wsdl1:materialChooseRequest" name="mcReq"/>
<variable messageType="wsdl1:materialChooseResponse" name="mcResp"/>
</variables>
<sequence name="Sequence" wpc:displayName="Sequence" wpc:id="1073741825">
<receive createInstance="yes" name="Receive"
operation="NewOperation" partnerLink="NewPortType"
portType="wsdl:NewPortType" variable="proReq"
wpc:displayName="Receive" wpc:id="2"/>
<assign name="Assign" wpc:displayName="Assign" wpc:id="5">
<copy>
<from part="ID" variable="proReq"/>
<to part="id" variable="mcReq"/>
</copy>
<copy>
<from part="METARIAL" variable="proReq"/>
<to part="material" variable="mcReq"/>
</copy>
<copy>
<from part="quantity" variable="proReq"/>
<to part="quantity" variable="mcReq"/>
</copy>
<copy>
<from part="rcdl" variable="proReq"/>
<to part="rcdl" variable="mcReq"/>
</copy>
<copy>
<from part="str" variable="proReq"/>
<to part="str" variable="mcReq"/>
</copy>
<copy>
<from part="mc" variable="proReq"/>
<to part="mc" variable="mcReq"/>
</copy>
<copy>
<from part="price" variable="proReq"/>
<to part="price" variable="mcReq"/>
</copy>
</assign>
<invoke inputVariable="mcReq" name="Invoke"
operation="materialChoose" outputVariable="mcResp"
partnerLink="MC1" portType="wsdl1:MC1"
wpc:displayName="Invoke" wpc:id="4"/>
<assign name="Assign1" wpc:displayName="Assign1" wpc:id="6">
<copy>
<from part="id" variable="mcResp"/>
<to part="id" variable="proResp"/>
</copy>
<copy>
<from part="materialChooseReturn" variable="mcResp"/>
<to part="mreturn" variable="proResp"/>
</copy>
<copy>
<from part="mc" variable="mcResp"/>
<to part="mc" variable="proResp"/>
</copy>
<copy>
<from part="price" variable="mcResp"/>
<to part="price" variable="proResp"/>
</copy>
</assign>
<reply name="Reply" operation="NewOperation"
partnerLink="NewPortType" portType="wsdl:NewPortType"
variable="proResp" wpc:displayName="Reply" wpc:id="3"/>
</sequence>
</process>
Iam very vexatious,because sometimes it's ok, sometimes it got the wrong message "badtype".if all of the parameter are int,there is nothing wrong.i don't know why. help me ,please! i am dysphoric,because i have to hand in the work in wednesday,please !
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Are you getting the web services input parameters dynamically, are you creating the input paramters and passing them. if you are getting then dynamically try to convert them to their respective types and pass.
 
april zhang
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my java code is as follows:

import javax.xml.rpc.holders.*;
public class MC1 {
public int materialChoose(IntHolder id, int material, int quantity, double rcdl, double str, StringHolder mc, DoubleHolder price) {
mc.value="Star";
price.value=7788;
return 111;
}
}

and I generate wsdl through eclipse, i can use it in eclipse test jsp successfully,but fail in bpel.is anything wrong with my java code?
 
pradeep jaladi
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

Your server has User Define objects ( Your own class ). try to do one thing write a small server side method like addNumber(int a, int b). Which returns a + b; . Know try to test it with your bpel code.
 
april zhang
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I generate the java code through eclipse-wtp-all-in-one +axis+tomcat.and I create the bple using IBM WEbsphere studio application develop intergration editor. is there something wrong with that? thank you very much for your help!!
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by april zhang:
I create the bple using IBM WEbsphere studio application develop intergration editor. is there something wrong with that?



Not in principle. However compatibility between the output of one tool and the allowable or expected input for another tool is rarely 100%. At that point you have to get "your hands dirty" and through a succession of small experiments determine where the possible problem areas are.
 
april zhang
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
quote:{hi,

Your server has User Define objects ( Your own class ). try to do one thing write a small server side method like addNumber(int a, int b). Which returns a + b; . Know try to test it with your bpel code.}


thank you very much for your answer.I try it already,It can works well ,if they are all int .
i have test my java code such as public int test(intHolder A,intHolder B) return "A,B,and a testRetrun"

I can also success in work public String test(StringHolder A,StringHolder B)

but if i want have many types' return ,I want the reply contain int string,double ,how can I do ?can't I use "public String test(intHolder A StringHolder B)"for a reply contain (int A,String B ,testReurn ),the three replys?
thank you again!!!
 
april zhang
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you tell me some methods to get not only one returntypes? I don't know how to do it without intHolder or Stringholder?thank you very much.
 
april zhang
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
anyone can help me ?thanks very much!!
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic