Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Getting Types, Elements & Methods in Service #2

Closed
lkatney opened this issue Aug 13, 2013 · 5 comments
Closed

Not Getting Types, Elements & Methods in Service #2

lkatney opened this issue Aug 13, 2013 · 5 comments

Comments

@lkatney
Copy link

lkatney commented Aug 13, 2013

I am simply parsing my WSDL file with wsdl.js.. it creates all types and elements in folders but while accessing , it shows null..

I am using below code:

var Service = require('itemQuery');
console.log('someRequest: '+JSON.stringify(Service));

If , I print Service through console.log..it shows :

someRequest: {"Types":{},"Elements":{},"Settings":{"debugSoap":false,"benchmark":true,"createMock":false,"useMock":false
,"modeler":{"debug":false}},"HTTP_Port":{},"HTTPS_Port":{}}

In this, I am not getting any types+ elements.HTTP_Port is my binding, but not getting method names...

I have checked my servicedefinition.js, it is fine with right structure.

As per my understanding, it is conflicting somewhere in index.js..

Does anyone ever faced this issue..Any help will be appreciated!!

@lkatney
Copy link
Author

lkatney commented Aug 13, 2013

I think, this part in index.js is not working:

parent[properties.input.replace("Element", "")] = function(json) {
var newObject = new models[properties.input](json, this);
this.request = function(callback) {
doSoapRequest(url, functionName, properties.soapAction, this,
properties.input, properties.output, namespace, callback);
};
Object.defineProperty(this, "request", { enumerable: false });
this.preview = function() {
return "<"+functionName+">"+jsonToXml(this)+"</"+functionName+">";
};
Object.defineProperty(this, "preview", { enumerable: false });
this.debug = function() {
console.log("----", functionName+" Request", "----");
console.log("JSON:", JSON.stringify(this, null, 2));
console.log("XML: ", this.preview());
console.log("Validates:", this.validate());
console.log("------------------------");
};
Object.defineProperty(this, "debug", { enumerable: false });
Object.preventExtensions(this);

@hxoliverrumbelow
Copy link

index.js is working fine.

This is how your filesystem should look after generating some code:

├── MyServiceName
│   ├── Element
│   │   ├── SomeElementName1.js
│   │   └── SomeElementName2.js
│   ├── index.js
│   ├── Modeler.js
│   ├── ServiceDefinition.js
│   └── Type
│       ├── SomeTypeName1.js
│       └── SomeTypeName2.js

The elements and types are loaded in index.js like this:

var includeList = fs.readdirSync(__dirname+"/Element");
...
var includeList = fs.readdirSync(__dirname+"/Type");

I expect you've moved the files/folders around and they're simply not in the correct place anymore.

@lkatney
Copy link
Author

lkatney commented Aug 13, 2013

Thanks for replying..

I haven't changed or moved files.. it is in same structure...if I use console.log to check include list , it prints all types and elements..but printing Service variable shows both type and elements null

@hxoliverrumbelow
Copy link

Something is stopping your node process from reading from those folders. Try checking the permissions on them, maybe you generated the code as a different user (root maybe?) and no longer have permission to read from them?

Beyond that, I can't help. It's a system issue. Sorry.

@lkatney
Copy link
Author

lkatney commented Aug 13, 2013

it is processing everything except for that particular section in index.js..Not creating any error as well...

I am system admin and have access to read files as well...I don't think that is a problem...

Anyways, thanks for your help..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants