WSO2 AS5.0에서 매시업을 만들려고합니다. 나는 단순한 HelloWorld 서비스를 성공적으로 만들었지 만, 다른 서비스를 통합하려고하면 오류가 발생합니다.WSO2 매시업 (인수가있는 외부 서비스 사용)
이 나의하여 HelloWorld 서비스입니다 :
this.documentation = "This is a test Hello World service";
system.include("HelloStub.js");
hello.documentation = "say hello"
hello.inputTypes = {"user": "string"}
hello.outputType = "string";
function hello(user){
try{
var response = services["admin/testmashup"].operations["sayMyName"](user);
}catch(e){
return "Danger, Robinson! " + e.toString()
}
return "Hello, there! " + response;
}
function whoAreYou(){
try{
var response = services["admin/testmashup"].operations["toString"]();
}catch(e){
return "Danger, Robinson! " + e.toString()
}
return "Hello! " + response;
}
그리고 이것은 admin/testmashup
서비스
this.serviceName = "testmashup";
this.documentation = "Test mashup service" ;
toString.documentation = "say something" ;
toString.inputTypes = { /* no arguments */ };
toString.outputType = "string";
function toString()
{
return "Hi, my name is testmashup";
}
sayMyName.documentation = "Make me feel happy";
sayMyName.inputTypes = {"myName":"string"};
sayMyName.outputType = "string";
function sayMyName(myName){
return "Your very beautiful name is " + myName;
}
나는 내가 admin/testmashup
서비스를 호출 할 때 예상대로 작동하는지주의해야합니다.
파일 HelloStub.js
은 WSO2 Applicanton Server에서 생성 한 Javascript (E4X) 스텁입니다.
<ws:whoAreYouResponse xmlns:ws="http://services.mashup.wso2.org/helloWorld?xsd">
<return xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:js="http://www.wso2.org/ns/jstype" js:type="string" xsi:type="xs:string">Hello! <ws:toStringResponse xmlns:ws="http://services.mashup.wso2.org/testmashup?xsd"><return>Hi, my name is testmashup</return></ws:toStringResponse></return>
</ws:whoAreYouResponse>
내가 인코딩 된 응답 내의 텍스트 Hi, my name is testmashup
을 볼 수
내가 인수가없는 작업 whoAreYou
을 테스트
hello
를 호출 할 때 : 나는 지난 며칠이 작품을 만들기 위해 노력하고 모든 검색 한
<ws:helloResponse xmlns:ws="http://services.mashup.wso2.org/helloWorld?xsd">
<return>Danger, Robinson! org.wso2.carbon.CarbonException: Invalid input for the payload in WSRequest Hostobject : John</return>
</ws:helloResponse>
: 나는 다음과 같은 오류가
<body>
<p:hello xmlns:p="http://services.mashup.wso2.org/helloWorld?xsd">
<!--Exactly 1 occurrence-->
<user>John</user>
</p:hello>
</body>
대답을 얻기 위해 장소를 찾았지만 찾을 수없는 것 같습니다. official documentation에는 하나 이상의 인수가있는 작업이있는 외부 웹 서비스의 스텁을 사용하는 예제가 없습니다.
또한 가능한 경우 자바 스크립트 매시업에서 REST-JSON 서비스를 사용하는 방법을 알고 싶습니다.
아이디어가 있으십니까?
을 그리고 난 내 자신의 질문에 대답 두 번째 시간입니다 ... 너무, 내가 게시 두 번째 질문이 아니었다면 전혀 이상하지 않을 것입니다 ... :
이 작동합니다 – chechopeefe