我只是试图将WSDl转换为来自WSDL提供的数据的许多不同的HTTP请求.我已经阅读了大量类似的问题,但没有一个真正提供了答案.
有人说使用SOAPUI - 我熟悉这个应用程序并使用它.但我需要自己从WSDL创建这些HTTP请求.
有人说要尝试JAXWS - 我在这个和Axis上查看了许多教程,这些教程将WSDL转换为Java类绑定,并使用这些方法来测试Web服务.我真的想自己生成HTTP请求,这样我就可以操作请求并发送自己的测试.
我开始使用wsdl4j开始自己解析WSDL,但是在我完全确定我没有重新发明轮子之前,我宁愿不要走这条路.在我看来,过去一直需要这个吗?但是使用WSDL4J和其他所有库我都没有看到SoDL消息转换的WSDL.
任何建议都会非常有帮助.目标是我希望能够获取WSDL,检查它并为WSDL中的每个方法创建HTTP-SOAP请求,并且能够测试它们的安全性问题.第一步是创建这些请求!
#include <string.h>
#include<stdio.h>
#include<stdlib.h>
char *chktype(char *Buffer, int Size)
{
char *strng = "Content-Type: ";
int sz;
char *found = strstr (Buffer, strng);
char *found1 = strstr(found, "\r\n");
sz=strlen(found)-strlen(found1);
char type[sz];
strncpy(type, found1, sz-1);
return(type);
}
void main(){
char *buffer = "HTTP/1.1 200 OK\r\nDate: Tue, 25 Jun 2013 16:27:16
GMT\r\nExpires: -1\r\nCache-Control: private,
max-age=0\r\nContent-Type: text/html;
charset=UTF-8\r\nContent-Encoding: gzip\r\nServer:
gws\r\nX-XSS-Protection: 1; mode=block\r\nX-Frame-Options:
SAMEORIGIN\r\nTransfer-Encoding: chunked\r\n\r\n";
char *extension = chktype (buffer, sizeof(buffer));
printf("%s\r\n", extension);
}
Run Code Online (Sandbox Code Playgroud)
这会产生:
warning: function returns address of local variable [enabled by …Run Code Online (Sandbox Code Playgroud) 好的,所以我有config.properties...:
market.curpairs[0].name=EuroDollar
market.curpairs[0].symbol=EURUSD
market.curpairs[0].minamount=0.1
market.curpairs[1].name=EuroFranken
market.curpairs[1].symbol=EURCHF
market.curpairs[1].minamount=0.1
market.currs[0].name=Euro
market.currs[0].symbol=EUR
market.currs[0].minamount=1.0
market.currs[0].withfee=0.1
market.currs[1].name=Dollar
market.currs[1].symbol=USD
market.currs[1].minamount=1.0
market.currs[1].withfee=0.1
market.currs[2].name=Franken
market.currs[2].symbol=CHF
market.currs[2].minamount=1.0
market.currs[2].withfee=0.1
Run Code Online (Sandbox Code Playgroud)
我然后尝试注入MarketConfig.java这样:
@PropertySource("classpath:config.properties")
@ConfigurationProperties(prefix = "market")
@Validated
public class MarketConfig {
// the configured currencies
private List<MarketCurrency> currs;
// the configured currencypairs
private List<MarketCurrencypair> curpairs;
/* static classes */
public static class MarketCurrency {
String name;
String symbol;
double minamount;
// getter and setter ommitted
}
public static class MarketCurrencypair {
String name;
String symbol;
double minamount;
double …Run Code Online (Sandbox Code Playgroud) 我在 C 课程中被分配了以下作业:
我已经实现了解码8 字节长的 int 131809282883593 的分配,如下所示:
#include <stdio.h>
#include <string.h>
struct Message {
unsigned int hour : 5;
unsigned int minutes : 6;
unsigned int seconds : 6;
unsigned int day : 5;
unsigned int month : 4;
unsigned int year : 12;
unsigned long long int code : 26;
}; // 64 bit in total
union Msgdecode {
long long int datablob;
struct Message elems;
};
int main(void) {
long long int datablob = 131809282883593;
union …Run Code Online (Sandbox Code Playgroud) 我有一个头文件,声明这些数组:
int stVal_On[] = {2};
int stVal_Off[] ={1};
int subVal_On[]={1};
int subMss[]={1};
int subVal_Off[]={0};
Run Code Online (Sandbox Code Playgroud)
然后在声明的结构中使用解除引用的数组:
WriteData结构的定义:
/* Write structure used in loop for Read- and Write Tests */
typedef struct WriteData {
char* name; // MMS object name
const VOID* data; // Data to write
const SINT32 localFormat; // SVI type (on server)
const SINT32 dataLength; // length of data to write/read
const SINT32 NbrofElmnts; // Number of elements to write/read
char* description; // SVI type as String (on server) …Run Code Online (Sandbox Code Playgroud) 我正在使用此方法从属性文件中读取:
public void loadConfigFromFile(String path) {
Properties prop = new Properties();
InputStream input = null;
try {
input = new FileInputStream(path);
prop.load(input);
/*saved like this:*/ //emails: abc@test.com, bbc@aab.com, ..
String wordsS = prop.getProperty("keywords");
String emailS = prop.getProperty("emails");
String feedS = prop.getProperty("feeds");
emails = Arrays.asList(emailS.split(",")); //ERROR !!
words = Arrays.asList( wordsS.split(","))); //ERROR !!
feeds = Arrays.asList( feedS.split(",")); //ERROR !!
} catch (IOException ex) {
ex.printStackTrace();
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) { …Run Code Online (Sandbox Code Playgroud)